Skip to content

Commit

Permalink
Generics goals (#24)
Browse files Browse the repository at this point in the history
The "generics" feature of Carbon is a large design effort that needs to be broken up into manageable steps. The first thing we need is a high-level goals document. The goals here reflect the desirable properties that we have discovered as part of considering several alternative generics designs:

-   Use cases:
    -   Generic programming
    -   Upgrade path from C++ abstract interfaces
    -   Dependency injection
     -   Generics instead of open overloading and ADL
-   Performance
-   Better compiler experience
-   Encapsulation
-   Predictability
-   Dispatch control
-   Upgrade path from templates
-   Coherence
-   No novel name lookup
-   Learn from others
-   Interfaces are nominal
-   Interop and evolution
-   Bridge for C++ customization points

Goals are summarized in [this presentation](https://docs.google.com/presentation/d/12yGyu5Pvdag7CJp-_yLVkmbhyvuRIilBTNlkO0LKaHo/edit?usp=sharing&resourcekey=0-JB9yrUO4-6J8-zzGhnIyNg).

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
Co-authored-by: Matthew Riley <mdriley@gmail.com>
Co-authored-by: austern <austern@google.com>
Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
  • Loading branch information
6 people authored Apr 24, 2021
1 parent e022ff1 commit a6ddc03
Show file tree
Hide file tree
Showing 5 changed files with 744 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/design/generics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Carbon: Generics

<!--
Part of the Carbon Language project, under the Apache License v2.0 with LLVM
Exceptions. See /LICENSE for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-->

This directory contains the collection of documents describing the generics
feature of Carbon:

- ~~Overview~~ - not implemented yet
- [Goals](goals.md) - The motivation and principles guiding the design
direction.
- ~~Terminology~~ - not implemented yet
- ~~Detailed design~~ - not implemented yet
- ~~Rejected alternatives~~ - not implemented yet
Loading

0 comments on commit a6ddc03

Please sign in to comment.