Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generics goals #24

Merged
merged 119 commits into from
Apr 24, 2021
Merged
Show file tree
Hide file tree
Changes from 118 commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
ef784a9
First draft of Generics principle doc
josh11b May 21, 2020
b537005
Ran prettier
josh11b May 21, 2020
0b3e05f
Reorganize so proposal is separate from proposed doc.
josh11b May 21, 2020
4c3ffed
Move proposals/ dir to location suggested by #11.
josh11b May 21, 2020
28806ed
Merge pull request #1 from carbon-language/master
josh11b May 21, 2020
a7abd57
Merge branch 'master' into principle-generics
josh11b May 21, 2020
18e73ed
Update header, removing fields we no longer want.
josh11b May 21, 2020
c1dd521
prettier take 2, now using the config file.
josh11b May 22, 2020
150d239
Update to new wrapping of license text header.
josh11b May 27, 2020
54f6626
Add link to latest generics doc.
josh11b May 30, 2020
5ae9e9b
Merge remote-tracking branch 'upstream/master'
josh11b May 31, 2020
9796b47
Merge branch 'master' into principle-generics
josh11b May 31, 2020
d4e1541
Apply suggestions from code review
josh11b May 31, 2020
75ac57e
Update link
josh11b Jun 5, 2020
33dd06c
Add coherence.
josh11b Feb 24, 2021
0bbca0c
Merge remote-tracking branch 'upstream/trunk' into principle-generics
josh11b Feb 24, 2021
b3c4adc
Fix presubmits.
josh11b Feb 25, 2021
4eaba40
Incorporate feedback and reformat.
josh11b Mar 8, 2021
45118b2
Merge remote-tracking branch 'upstream/trunk' into principle-generics
josh11b Mar 9, 2021
fcbce40
Update to current proposal template.
josh11b Mar 9, 2021
0dd005a
Fix proposals_test.
josh11b Mar 9, 2021
bb7fa5f
Use "parameter" instead "argument" in several places.
josh11b Mar 9, 2021
22094ee
Missed lexer changes in earlier commit.
josh11b Mar 15, 2021
209fca6
Move & expand expressive principle into the goal and new closed overl…
josh11b Mar 15, 2021
c3f4138
Resolve conflicts
josh11b Mar 15, 2021
ace9751
Update docs/project/principles/principle-generics.md
josh11b Mar 17, 2021
be7a752
Update name lookup section.
josh11b Mar 17, 2021
5c0bdc0
Clarify difference between generics and templates. Add TOC.
josh11b Mar 18, 2021
2e8b955
Address some suggestions, reorganize content, expand on interop.
josh11b Mar 18, 2021
36f6382
Add "learn from others".
josh11b Mar 19, 2021
d22e540
Rewrite dispatch control based on feedback that it was unclear.
josh11b Mar 19, 2021
199a014
One more sentence to clarify about overloading.
josh11b Mar 19, 2021
6b78a49
Summarize content from `generics/motivation.md` as "use cases".
josh11b Mar 19, 2021
d20146b
Change from a principle to "generics goals".
josh11b Mar 19, 2021
e223b74
Attempt to fix test failures.
josh11b Mar 19, 2021
ca8071f
Relative path should be more robust.
josh11b Mar 19, 2021
c99c8f7
Stop calling inheritance evil.
josh11b Mar 22, 2021
a182fd9
Merge remote-tracking branch 'upstream/trunk' into principle-generics
josh11b Mar 22, 2021
0b7b196
README.md files are required for every docs/ subdirectory.
josh11b Mar 22, 2021
8dcbae7
Redo performance goal. Refine terminology around template typing.
josh11b Mar 23, 2021
26f3cd1
Checkpoint progress.
josh11b Mar 23, 2021
138e242
Use rephrase suggestion.
josh11b Mar 23, 2021
c560eab
Use @zygoloid 's suggested text re: JIT specialization strategy.
josh11b Mar 23, 2021
7b15140
Rewrote text re: type constraints used for templates too.
josh11b Mar 23, 2021
689c693
Identify specific improvements in "better compiler experience" section.
josh11b Mar 23, 2021
d33428b
Expand dependency injection. Add "predictability" section.
josh11b Mar 23, 2021
ff74a55
Move open overloading. Mark nice to have. Name conflicts from evolution.
josh11b Mar 23, 2021
843e68e
More rewriting "interop and evolution".
josh11b Mar 23, 2021
ac4bd13
Include suggestion about constraints on multiple parameters.
josh11b Mar 25, 2021
a723a5e
Merge remote-tracking branch 'upstream/trunk' into principle-generics
josh11b Mar 25, 2021
0ec3dad
Merge branch 'principle-generics' of github.com:josh11b/carbon-lang i…
josh11b Mar 25, 2021
647dac1
Apply suggestions.
josh11b Mar 25, 2021
9fe02ac
Accept suggestion
josh11b Mar 25, 2021
0399b33
Incorporate suggestions.
josh11b Mar 25, 2021
6e9f191
Rewrite coherence property in terms of interfaces.
josh11b Mar 28, 2021
3b32fd0
Clarify some template language.
josh11b Mar 29, 2021
f0047f0
Link to Rust's doc on coherence and orphan rules.
josh11b Mar 29, 2021
8eaa09e
Clarify pros/cons of coherence.
josh11b Mar 29, 2021
ddae41d
Merge remote-tracking branch 'upstream/trunk' into principle-generics
josh11b Mar 29, 2021
62ac9d2
Merge remote-tracking branch 'upstream/trunk' into principle-generics
josh11b Mar 29, 2021
f2d7f70
Remove 'Notably'
josh11b Mar 29, 2021
80b141f
Remove slashes
josh11b Mar 29, 2021
14e6c48
Restructure non-goal section.
josh11b Mar 30, 2021
d1c490e
Remove parens. Move text about templates to background.
josh11b Mar 30, 2021
a57373b
The expression problem is in tension with coherence.
josh11b Apr 1, 2021
c2f8107
Add scoped conformances to coherence section.
josh11b Apr 1, 2021
52f6ec5
Undecidability that is expected and ok vs. proof search at compile time.
josh11b Apr 2, 2021
068d072
Coherence useful for templates.
josh11b Apr 2, 2021
4fe9a7e
More about evolution.
josh11b Apr 2, 2021
194791a
Link to Rust's newtype pattern for controlling interface impl.
josh11b Apr 2, 2021
6c58d72
C++ extension bridge
josh11b Apr 2, 2021
989a438
Add defaults to "learn from others". Link for ADL.
josh11b Apr 3, 2021
3ecfbdf
Merge remote-tracking branch 'upstream/trunk' into principle-generics
josh11b Apr 3, 2021
590fe54
Clean up "Upgrade path from C++ abstract interfaces".
josh11b Apr 3, 2021
aca1ebd
Add the tricky `Abs` case as something to solve.
josh11b Apr 3, 2021
4cc5657
Link to example using defaults.
josh11b Apr 5, 2021
a145346
Generics definition section revamp.
josh11b Apr 6, 2021
b8073d5
Clarify functions with any template parameter has the template limita…
josh11b Apr 6, 2021
dc56a7b
Update "Learn from others".
josh11b Apr 6, 2021
51145cb
Reorganize out-of-scope / non-goals.
josh11b Apr 6, 2021
66058ee
Address code review comments.
josh11b Apr 8, 2021
6474c73
Merge remote-tracking branch 'upstream/trunk' into principle-generics
josh11b Apr 9, 2021
5be10ec
Commit suggestion
josh11b Apr 9, 2021
26c6f09
Commit suggestion
josh11b Apr 9, 2021
b6a2499
Merge branch 'principle-generics' of github.com:josh11b/carbon-lang i…
josh11b Apr 9, 2021
8ece23f
Update in response to feedback.
josh11b Apr 9, 2021
3e85927
Small update to README.
josh11b Apr 12, 2021
f5b1fa7
Merge remote-tracking branch 'upstream/trunk' into principle-generics
josh11b Apr 13, 2021
74fe0c9
Proposals now include a rationale.
josh11b Apr 13, 2021
0d0c3fa
Commit suggestion
josh11b Apr 16, 2021
fad5e7d
Commit suggestion
josh11b Apr 16, 2021
5ea59fd
Commit suggestion
josh11b Apr 16, 2021
1d7e679
Commit suggestion
josh11b Apr 16, 2021
bfed53e
Fix formatting.
josh11b Apr 16, 2021
b10c8b2
Accept suggestion
josh11b Apr 16, 2021
b7acfe2
Commit suggestion
josh11b Apr 16, 2021
b633c5f
Markdown instead of HTML strikethrough.
josh11b Apr 16, 2021
b703086
Commit suggestion
josh11b Apr 18, 2021
559e987
Commit suggestion
josh11b Apr 18, 2021
c6bc500
Apply suggestions from code review
josh11b Apr 18, 2021
51bd5a1
Apply suggestions from code review
josh11b Apr 18, 2021
038afc0
Apply suggestions from code review
josh11b Apr 18, 2021
f12a5c1
Implement suggestion and fix formatting.
josh11b Apr 18, 2021
88bef3e
Text rewrites from open suggestions.
josh11b Apr 20, 2021
731308a
Test relative vs. absolute links.
josh11b Apr 20, 2021
db4f940
Switch to absolute links to avoid "../../".
josh11b Apr 20, 2021
8a147e6
Commit suggestion
josh11b Apr 20, 2021
6c59a7c
Make changes in response to suggestions.
josh11b Apr 20, 2021
a03d7b5
Weaken requirement to support dynamic strategy.
josh11b Apr 20, 2021
0034bea
Apply suggestions from code review
josh11b Apr 21, 2021
e41441e
Move bit about customization points to the extension points section.
josh11b Apr 21, 2021
9b4a064
Rewrite unclear sentence.
josh11b Apr 22, 2021
3d5bce6
Address some feedback.
josh11b Apr 22, 2021
4e0e0aa
Differences between dynamic and static strategy unobservable.
josh11b Apr 22, 2021
c53033a
Address more feedback.
josh11b Apr 22, 2021
38845e2
Add text from blocking issue #477.
josh11b Apr 22, 2021
4b731bb
Apply suggestions from code review
josh11b Apr 23, 2021
5135a99
Formatting.
josh11b Apr 23, 2021
2cc6115
Merge remote-tracking branch 'upstream/trunk' into principle-generics
josh11b Apr 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
681 changes: 681 additions & 0 deletions docs/design/generics/goals.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions proposals/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ request:
<!-- proposals -->
<!-- Generated by ./scripts/update_proposal_list.py -->

- [0024 - Generics goals](p0024.md)
- [0029 - Linear, rebase, and pull-request GitHub workflow](p0029.md)
- [0029 - Decision](p0029_decision.md)
- [0042 - Create code review guidelines](p0042.md)
Expand Down
38 changes: 38 additions & 0 deletions proposals/p0024.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generics goals

<!--
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/24)

## Problem

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:

- to make sure we agree on the approach we are taking,
- to clearly communicate expectations to contributors for future steps,
- to encourage us to solve problems in the design in a consistent way,
- to provide a yardstick for measuring different alternatives under
consideration.

## Background

The question of what a generics feature would look like in Carbon has been an
ongoing discussion, with many alternative proposals. Of course there have been a
number of use cases that we want to address with this feature, but over the
course of this process we have discovered a number of desirable properties we
would like to achieve with any solution.

## Proposal

See the [generics goals document](/docs/design/generics/goals.md).

## Rationale

The goals here well reflect Carbon's goals as applied to the specifics of the
generics feature.
9 changes: 8 additions & 1 deletion proposals/scripts/proposals_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ def test_get_path(self):
p = proposals.get_list(proposals_path)
self.assertEqual(
p[0],
(
mmdriley marked this conversation as resolved.
Show resolved Hide resolved
"0024 - Generics goals",
"p0024.md",
),
)
self.assertEqual(
p[1],
(
"0029 - Linear, rebase, and pull-request GitHub workflow",
"p0029.md",
),
)
self.assertEqual(p[1], ("0029 - Decision", "p0029_decision.md"))
self.assertEqual(p[2], ("0029 - Decision", "p0029_decision.md"))


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion website/jekyll/gen_sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def crawl(top):
rel_dir = os.path.relpath(parent_dir, top)
readme, files = list(_filter_files(parent_dir, rel_dir, raw_files))
if readme is None:
assert not files
assert not files, "Every directory under docs/ needs a README.md."
continue

# Sort and put the README first when setting up the dir.
Expand Down
9 changes: 8 additions & 1 deletion website/jekyll/gen_sidebar_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,20 @@ def test_crawl(self):
)
self.assertEqual(
proposals.files[1],
(
"0024 - Generics goals",
"/proposals/p0024.md",
),
)
self.assertEqual(
proposals.files[2],
(
"0029 - Linear, rebase, and pull-request GitHub workflow",
"/proposals/p0029.md",
),
)
self.assertEqual(
proposals.files[2],
proposals.files[3],
("0029 - Decision", "/proposals/p0029_decision.md"),
)

Expand Down