-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 overview #524
Generics overview #524
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Through the doc, there's some syntax that doesn't reflect current Carbon syntax. Things like Ptr
slow me down as I try to read this doc, as I need to mentally translate syntax.
I see a lot of discussion of Carbon's template behavior and syntax. On #24 I felt there was pushback on handling template design, however, this doc seems to be going in the other direction. This creates a tension for me of not being sure what you're trying to design here.
Having reached "implicit parameters" and [Int n]
syntax (which appears to be neither generic nor template syntax), I now feel out of depth on this design. I don't feel comfortable reviewing syntax for things that aren't being discussed.
Noting that approval of the doc implies approval of the contained design decisions, I would personally prefer for this to be tightened up more to talk more specifically about generics, and avoid discussion of other potential features, unless all features contained are going to be justified. As it is, I don't feel comfortable reviewing further because I lack sufficient background to review.
I will update the syntax soon, seems like there are a number of relevant issues that are getting close to decisions.
I removed most of the template content, except a few things contrasting generics with templates.
This syntax is more general than generics, and is introduced as a more general feature, but we wouldn't have it except for the use cases for generics.
|
Co-authored-by: Jon Meow <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to make a pass over all of this. I feel like I may have missed some stuff, but can catch that after a revision.
Co-authored-by: Chandler Carruth <[email protected]>
This PR is on hold while @wolffg and I work on a significant restructuring. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I said it while I was going through things, but just wanted to lead with this is well: I think this is a really fantastic overview document. Super impressed by how approachable it is and yet how much it manages to cover. Really nicely done.
Most of my comments below are pretty minor attempts to tweak and improve wording. I don't actually have any substantive concerns here. Leaving open mostly to let some others take a look and get an official stamp from leads on this since I think this really gets the core of everything about generics outlined. I'm roughly 99% sure there is consensus here already, but seems good to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this seems good to land!
Co-authored-by: Wolff Dobson <[email protected]>
Co-authored-by: Wolff Dobson <[email protected]>
Co-authored-by: Wolff Dobson <[email protected]>
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 <[email protected]> Co-authored-by: Chandler Carruth <[email protected]> Co-authored-by: Wolff Dobson <[email protected]>
This adds an overview of a generics feature that attempts to achieve the goals from #24 . It has been summarized in these presentations: