Replies: 14 comments 21 replies
-
Neither? Not sure what's the point of digging out mixed-case types again? Either types should start with uppercase letters, or they should start with lowercase letters. Having special rules for 7(?) types that get to start with a lowercase letter, while all the other types start with uppercase letters feels pretty silly in 2022. To be honest ...
... seems to be the worst of both worlds. |
Beta Was this translation helpful? Give feedback.
-
i64 good for me. Do you like float64? f64 vs float64? |
Beta Was this translation helpful? Give feedback.
-
I think principle of least surprise is the best approach here. It also serves the "gentle learning curve with reasonable familiarity for C++ developers" goal. |
Beta Was this translation helpful? Give feedback.
This comment was marked as disruptive content.
This comment was marked as disruptive content.
-
Yes experienced C++ programmers can guess. But just because someone can guess does not mean its a good idea. When designing a language, or code in general, its best to design it in such a way that cognitive load is reduced as much as possible. Users only have so much cognitive capacity and it should be conserved for more important uses than trying to remember what We must also consider non-experienced engineers, who will not be as quick to guess the meaning if The less ambiguity in a language/code, the better. Of course is must be balanced with readability thats why we don't choose |
Beta Was this translation helpful? Give feedback.
-
As I'm against changing the keyword names I'll list my counter points
|
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
OK, sorry for that. I'll keep series and talk only the tech here. But don't be affected if you are pretty confident about some grammar level decision. Grammar is always trivial and doesn't really help. Carbon is not for better grammar, it's for a better high level ast orientation. |
Beta Was this translation helpful? Give feedback.
-
using |
Beta Was this translation helpful? Give feedback.
-
It makes more sense to start as int64 because people may have a hard time remembering the old syntax association with i64 |
Beta Was this translation helpful? Give feedback.
-
1, syntax is trivial. People should train to be able to read and write different syntax. This should not cost much time. |
Beta Was this translation helpful? Give feedback.
-
Wild suggestion: int is a primitive template-style type that takes size as a template parameter (I will use c++ pseudo code using made up names):
Only allow parameter values for whatever the system it is being compiled for (currently typically 8, 16, 32, 64 and maybe 128). It makes no sense to allow int<7> if that means int<8> has to be allocated. So what if int<128> is not available on a system?
But why stop there?
Let's go even further?
Using i instead of int is obviously not a good idea in this case. This would have to be fleshed out a lot more ofcourse, but I would be impressed if Carbon offers a mechanism to better deal with future evolutions in computing. How long have developers been porting 32-bit to 64-bit now? |
Beta Was this translation helpful? Give feedback.
-
What about supporting both? |
Beta Was this translation helpful? Give feedback.
-
as I know, type notations like |
Beta Was this translation helpful? Give feedback.
-
Using C++-like integer type names such as
int64
over Rust-likei64
has been suggested multiple of times: #1690, #1496, #1520 (reply in thread), #1686.int64_t
, there is considerable precedent for theint64
-style naming.i64
too short for readability. I've never heard anyone complain aboutint64
being too long.Int64
-style naming. Out of the major languages, only Rust (which is not a successor language) uses thei64
-style naming.Creating a poll to see what the Carbon community thinks.
321 votes ·
Beta Was this translation helpful? Give feedback.
All reactions