My thoughts on Carbon #1596
Replies: 8 comments 8 replies
-
I like that they use fn and ->. |
Beta Was this translation helpful? Give feedback.
-
Regarding the function syntax whats the reason behind placing the return type at the end of the function? Personally I find it easier to have the function syntax like it is in C++ because I immediately see what the function returns no matter how long it is, but im wondering is there a technical reason behind this? This also extends to the variable declaration, if I have something like
vs
For me personally I feel that the second is easier to read because I don't have to go looking for the type. Again im just wondering if theres a technical reason for this or if comes down to preference. Thanks 😄 |
Beta Was this translation helpful? Give feedback.
-
Well I think that the motivation for this new sintaxe it's because the formal notation of type theory, https://en.wikipedia.org/wiki/Type_theory . |
Beta Was this translation helpful? Give feedback.
-
Declarations such as https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p0618.md goes over the |
Beta Was this translation helpful? Give feedback.
-
[0]: This one shows that single letter processing speed is much much lower than word processing speed. Wonder what happens when special characters are compared. My guess would be that the gap widens even more and favors words instead of symbols/single letters. |
Beta Was this translation helpful? Give feedback.
-
why use its a strongly typed language with ILLUSION of weakly typed |
Beta Was this translation helpful? Give feedback.
-
I agree some of your ideas. But I also would like to say something. Let me only mention what I don't agree.
Sometimes, it's about the readability. But maybe it's better to maintain multiple grammars and separate them somehow.
Macros is probably the biggest obstacle for auto completion. Auto completion is so important that all the features should give the way to it. Except for what I mentioned, I agree with all the other ideas. Documentations and examples are so important, I would like to recommend add them into language specification. |
Beta Was this translation helpful? Give feedback.
-
I think it's much more useful to agree, that the bike shed will be red and move on to the more important topics. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm C++ developer, and I'm interesting this new language. I wanted to share my thoughts and suggestions as I feel I may be using this language in the future and I would like it to nice to use.
Things I like:
concepts
) in C++20. Generics passed as function arguments is also great and makes the code way cleaner.std::cout operator<<
syntax gone, replaced with much more concise thePrint
functionThings I don't like:
fn
keyword, and->
symbol. I personally feel like the way functions are defined in C++ is more elegant.i32 x = 42
, I would have to writevar x: i32 = 42
, this just means I have to type more to declare a variable. I understand that this syntax probably makes the language easier to parse but for a language that is trying to be a "successor to C++", I don't think it would help migrating C++ developers.Things would be nice to have:
Anyway, I hope my feedback is useful
ty bye
Beta Was this translation helpful? Give feedback.
All reactions