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

Checked and template generic terminology #2138

Merged
merged 9 commits into from
Sep 10, 2022
Merged

Conversation

josh11b
Copy link
Contributor

@josh11b josh11b commented Sep 1, 2022

Change terminology from "generics" and "templates" to "checked generics" and "template generics". Afterwards, "generics" will be an umbrella term that include templates.

@josh11b josh11b added proposal A proposal proposal draft Proposal in draft, not ready for review labels Sep 1, 2022
@josh11b josh11b marked this pull request as ready for review September 1, 2022 21:56
@github-actions github-actions bot added proposal rfc Proposal with request-for-comment sent out and removed proposal draft Proposal in draft, not ready for review labels Sep 1, 2022
@josh11b josh11b requested review from chandlerc and removed request for jonmeow September 1, 2022 21:57
Copy link

@JamesJCode JamesJCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the terminology change makes sense and is a clean approach. Minor grammar point in-line.

proposals/p2138.md Outdated Show resolved Hide resolved
proposals/p2138.md Outdated Show resolved Hide resolved
Copy link
Contributor

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a proposal, shouldn't this offer some rationale for switching? @chandlerc @zygoloid I see you thumbs-upped this proposal, is this good enough for the leads?

proposals/p2138.md Show resolved Hide resolved
proposals/p2138.md Outdated Show resolved Hide resolved
@chandlerc
Copy link
Contributor

As a proposal, shouldn't this offer some rationale for switching? @chandlerc @zygoloid I see you thumbs-upped this proposal, is this good enough for the leads?

I think the "Problem" section outlines the primary rationale I have for liking this change.

And I think its wording maps pretty cleanly to the specific goals cited in the rationale section? Happy to add more detail here if needed though.

Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, this looks good to me. And the direction I think all of the leads have thought about now and are happy with.

But I'd like to wait for Jon to get a chance to review and make sure the actual proposal is doing a reasonable job here.

since our documentation governing the interpretation of that code will be
more easily understood and with greater accuracy.
- [Interoperability with and migration from existing C++ code](/docs/project/goals.md#interoperability-with-and-migration-from-existing-c-code)
since there will be a smaller terminology gap between Carbon and C++.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this just shifting the terminology gap, because "templates" are now "template generics"? How does this reduce the terminology gap?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the specific improvement is that in C++, people talk about doing generic programming with templates, and with this shift in terminology you can talk about doing generic programming with template [generic]s in Carbon too.

proposals/p2138.md Outdated Show resolved Hide resolved
proposals/p2138.md Show resolved Hide resolved
proposals/p2138.md Show resolved Hide resolved
since our documentation governing the interpretation of that code will be
more easily understood and with greater accuracy.
- [Interoperability with and migration from existing C++ code](/docs/project/goals.md#interoperability-with-and-migration-from-existing-c-code)
since there will be a smaller terminology gap between Carbon and C++.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the specific improvement is that in C++, people talk about doing generic programming with templates, and with this shift in terminology you can talk about doing generic programming with template [generic]s in Carbon too.

Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just being explicit this still LGTM, including the update to dig into parameters.

Copy link
Contributor

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding alternatives. I'll continue to respectfully disagree that "template generics" is lowering the terminology gap versus "templates" for C++ developers (Carbon was probably the first time I really thought about "generic programming" beyond either templates or generics), but I think my structural proposal concerns have been addressed.

Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is ready to go, approving for the leads!

@chandlerc chandlerc merged commit 83f1d29 into carbon-language:trunk Sep 10, 2022
@josh11b josh11b deleted the term branch September 12, 2022 19:31
@josh11b josh11b added proposal accepted Decision made, proposal accepted and removed proposal rfc Proposal with request-for-comment sent out labels Oct 28, 2022
github-merge-queue bot pushed a commit that referenced this pull request Aug 2, 2023
This reflects changes from a number of approved proposals:
- #920 : concrete statements about orphan and overlap in Carbon
- #2138 : "generic" -> "checked generic", "template" -> "template
generic"
- #2188 : binding patterns are forbidden in type position
- #2360 : "type", "facet type", "facet". Note: I am not using the term
"generic type" from #2360 since that meaning conflicts with the
generally accepted meaning of "generic type" of a type with a
compile-time parameter.
- #2760 / #2770 : internal/external impl -> extending impl
- #2964 : "symbolic constant" and "template constant"

---------

Co-authored-by: Geoff Romer <[email protected]>
Co-authored-by: Richard Smith <[email protected]>
This was referenced Aug 3, 2023
github-merge-queue bot pushed a commit that referenced this pull request Aug 5, 2023
This reflects changes from #2138 , plus a number of other updates,
including reflecting that we have decided to include templates in
Carbon.
github-merge-queue bot pushed a commit that referenced this pull request Aug 15, 2023
This reflects changes from a number of approved proposals:

- #2138 : "generic" -> "checked generic", "template" -> "template
generic"
- #2360 : "type", "facet type", "facet". Note: I am not using the term
"generic type" from #2360 since that meaning conflicts with the
generally accepted meaning of "generic type" of a type with a
compile-time parameter.
- #2760 / #2770 : internal/external impl -> extending impl
- #2964 : "symbolic constant" and "template constant"

---------

Co-authored-by: Richard Smith <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Aug 31, 2023
Most changes are due to proposal #2360, but this also includes changes
to reflect: #1136, #2138, #2006, #2550, and #2964.

---------

Co-authored-by: Richard Smith <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Sep 8, 2023
Incorporates proposals: #1885, #2138, #2188, #2200, #2360, #2760, #2964,
and #3162.

---------

Co-authored-by: Richard Smith <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Sep 19, 2023
First step in updating `docs/design/generics/details.md`. It
incorporates changes from proposals: #989 #2138 #2173 #2200 #2360 #2964
#3162 , but there are still more changes from those proposals to be
made.

It also switches away from suggesting static-dispatch witness tables,
and creates an appendix to describe that decision.

---------

Co-authored-by: Richard Smith <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Sep 23, 2023
Includes proposals:
- #990
- #2188
- #2138
- #2200
- #2360
- #2760
- #2964
- #3162

Also tries to use more precise language when talking about:
- implementations, to avoid confusing `impl` declaration and definitions
with the `impls` operator used in `where` clauses, an issue brought up
in #2495 and #2483;
- "binding patterns", like `x: i32`, and "bindings" like `x`.

---------

Co-authored-by: Chandler Carruth <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Oct 3, 2023
Continued from part 1: #3231. Second step updating
`docs/design/generics/details.md`. There remains some work to
incorporate proposal #2200.

- The biggest changes are incorporating much of the text of proposals:
  - #2173
  - #2687
- It incorporates changes from proposals:
  - #989
  - #1178
  - #2138
  - #2200
  - #2360
  - #2964
  - #3162
- It also updates the text to reflect the latest thinking from leads
issues:
  - #996
  - #2153 -- most notably deleting the section on `TypeId`.
- Update to rule for prioritization blocks with mixed type structures
from [discussion on
2023-07-18](https://docs.google.com/document/d/1gnJBTfY81fZYvI_QXjwKk1uQHYBNHGqRLI2BS_cYYNQ/edit?resourcekey=0-ql1Q1WvTcDvhycf8LbA9DQ#heading=h.7jxges9ojgy3)
- Adds reference links to proposals, issues, and discussions relevant to
the text.
- Also tries to use more precise language when talking about
implementations, to avoid confusing `impl` declaration and definitions
with the `impls` operator used in `where` clauses, an issue brought up
in
  - #2495 
  - #2483

---------

Co-authored-by: Richard Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal accepted Decision made, proposal accepted proposal A proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants