mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
This adds an overview of a generics feature that attempts to achieve the goals from #24 . It has been summarized in these presentations: - [non-type params](https://docs.google.com/presentation/d/1IZaDxP5Y3Wqprkyjzagv48tyxEeIcfz8FZS3Namsvew/edit#slide=id.p) - [basic usage](https://docs.google.com/presentation/d/1OZiMTVW2Ommop5WTs9RyEwnGxy9yzaAPF7Cj5KUfDsY/edit?resourcekey=0-Nya0Soz3ZNs3hJan8VIrTA#slide=id.p) - [more advanced usage](https://docs.google.com/presentation/d/1bg6q0Q9Sk4YpRbNA3D3H34xYtaEO8ScAUNUZK2UTi80/edit?resourcekey=0-6-Y6e1mfRUmHg-Zk65Gc5A#slide=id.p) Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com> Co-authored-by: Chandler Carruth <chandlerc@gmail.com> Co-authored-by: Wolff Dobson <wolffg@users.noreply.github.com>
60 lines
1.9 KiB
Markdown
60 lines
1.9 KiB
Markdown
# Generics overview
|
|
|
|
<!--
|
|
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
|
|
-->
|
|
|
|
[Pull request](https://github.com/carbon-language/carbon-lang/pull/524)
|
|
|
|
<!-- toc -->
|
|
|
|
## Table of contents
|
|
|
|
- [Problem](#problem)
|
|
- [Background](#background)
|
|
- [Proposal](#proposal)
|
|
- [Rationale based on Carbon's goals](#rationale-based-on-carbons-goals)
|
|
- [Alternatives considered](#alternatives-considered)
|
|
|
|
<!-- tocstop -->
|
|
|
|
## Problem
|
|
|
|
We want to Carbon to have a high quality generics feature that achieves the
|
|
goals set out in [#24](https://github.com/carbon-language/carbon-lang/pull/24).
|
|
This is too big a feature to land in a single proposal. This proposal specifies
|
|
the feature at the level of an overview description. This overview document is
|
|
intended to act as a starting point for people interested in the generics
|
|
feature by providing:
|
|
|
|
- a high-level description of the generics feature, and
|
|
- pointers to documents that go deeper into individual topics.
|
|
|
|
## Background
|
|
|
|
This is a follow on to these previous generics proposals:
|
|
|
|
- [Generics goals #24](https://github.com/carbon-language/carbon-lang/pull/24)
|
|
- [Generics terminology #447](https://github.com/carbon-language/carbon-lang/pull/447)
|
|
|
|
The content for this proposal was extracted from a larger
|
|
[Generics combined draft proposal](https://github.com/carbon-language/carbon-lang/pull/36).
|
|
|
|
## Proposal
|
|
|
|
This is a proposal to add
|
|
[this overview document](/docs/design/generics/overview.md).
|
|
|
|
## Rationale based on Carbon's goals
|
|
|
|
Much of this rationale was captured in the
|
|
[Generics goals proposal](https://github.com/carbon-language/carbon-lang/pull/24).
|
|
|
|
## Alternatives considered
|
|
|
|
Alternatives considered will be in a future proposal. Some of them can be seen
|
|
in a rough form in
|
|
[#36](https://github.com/carbon-language/carbon-lang/pull/36).
|