-
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
Principle: All APIs are library APIs #1280
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.
Looks really good to me, but would like to double check w/ other leads as well.
A minor enhancement to the rationale suggested as well.
### Built-in primitive types | ||
|
||
We could follow the general outline of C++, where arithmetic and pointer types | ||
are built-in. However, that would substantially erode the advantages outlined | ||
above. We expect Carbon to have multiple kinds of pointers (for example, to | ||
represent different kinds of ownership), and multiple kinds of arithmetic types | ||
(for example, to handle overflow in different ways). They can't all be built-in, | ||
so putting even the common-case types in the library helps ensure that Carbon | ||
has enough expressive power for the uncommon-case library types. |
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.
Maybe worth calling out that C++ specifically has ended up with built-in types becoming inconsistent with user-defined types, and this has actually caused real problems with generic code (such as in templates) that is attempting to support both?
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 (with the suggested typo fix)
Actually, I can just merge this with the typo fix, it already tracks who it is authored by. Of course, we can fix-forward if there is any issue uncovered here.
Sorry for the noise. I forgot I suggested an enhanced rationale for not following C++ here. Let's see if that makes sense or not before merging w/o it...
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.
Gah, mashed the wrong button. Requesting changes until I confirm w/ other leads.
Oh, I also wanted to explicitly say I like describing this as "the APIs are library APIs" -- I think that does a great job of capturing the goal here. |
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.
Looks great to me.
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 (with the suggested typo fix)
Co-authored-by: Richard Smith <[email protected]>
Actually, I can just merge this with the typo fix, it already tracks who it is authored by. Of course, we can fix-forward if there is any issue uncovered here. |
Co-authored-by: Chandler Carruth <[email protected]> Co-authored-by: Richard Smith <[email protected]>
No description provided.