Live data from Hacker News

Carbon Language: An experimental successor to C++

docs.carbon-lang.dev

11–20 of 200 posts

Re: Carbon Language: An experimental successor to C++

#11

[2022]

It's an ongoing project, specifying a date here wouldn't make much sense.

is there any news? the website has no information and doesn't really highlight anything other than their launch at a conference in 2022.

Re: Carbon Language: An experimental successor to C++

#12
post #6

It's become a pet peeve of mine, but for the love of God, if anyone with input in Carbon is scanning this, what can be done to use "func" instead of "fn" as a keyword? That all-consonant keyword always makes it seem like I'm reading Hungarian notation when reading Rust for instance. An other options I've seen for instance in Pony, "fun", is already an English word with a completely different meaning. Even the "functi…

C++ does not have a function keyword at all, I wonder why did they add it in the first place.

To avoid any possibility of reintroducing the Most Vexing Parse?

https://en.wikipedia.org/wiki/Most_vexing_parse

Re: Carbon Language: An experimental successor to C++

#13
post #6

It's become a pet peeve of mine, but for the love of God, if anyone with input in Carbon is scanning this, what can be done to use "func" instead of "fn" as a keyword? That all-consonant keyword always makes it seem like I'm reading Hungarian notation when reading Rust for instance. An other options I've seen for instance in Pony, "fun", is already an English word with a completely different meaning. Even the "functi…

C++ does not have a function keyword at all, I wonder why did they add it in the first place.

The c++ notation for functions (and types in general) is horrible, and makes parsing much more expensive than it needs to be. Fixing it is step one if you are making a modern language.

Re: Carbon Language: An experimental successor to C++

#14
post #6

It's become a pet peeve of mine, but for the love of God, if anyone with input in Carbon is scanning this, what can be done to use "func" instead of "fn" as a keyword? That all-consonant keyword always makes it seem like I'm reading Hungarian notation when reading Rust for instance. An other options I've seen for instance in Pony, "fun", is already an English word with a completely different meaning. Even the "functi…

"func" is fine; "function" is too long. "fn" is also good, but for example, Go was designed with "func," and it's one of the most successful, readable languages in the world, so why not?

Re: Carbon Language: An experimental successor to C++

#15
post #6

It's become a pet peeve of mine, but for the love of God, if anyone with input in Carbon is scanning this, what can be done to use "func" instead of "fn" as a keyword? That all-consonant keyword always makes it seem like I'm reading Hungarian notation when reading Rust for instance. An other options I've seen for instance in Pony, "fun", is already an English word with a completely different meaning. Even the "functi…

In C++ you can use indifferently either the class or typename keyword to introduce template arguments (because of course you can). A lot of styleguides suggest using typename because class is slightly misleading (the type could be anything not just a class).

In practice everybody just uses class, because who as the time to type the full keyword and signature declarations in C++ are already unwieldy as it is.

Re: Carbon Language: An experimental successor to C++

#16
post #6

It's become a pet peeve of mine, but for the love of God, if anyone with input in Carbon is scanning this, what can be done to use "func" instead of "fn" as a keyword? That all-consonant keyword always makes it seem like I'm reading Hungarian notation when reading Rust for instance. An other options I've seen for instance in Pony, "fun", is already an English word with a completely different meaning. Even the "functi…

C++ does not have a function keyword at all, I wonder why did they add it in the first place.

It doesn't, but you can pretend it does:

  auto my_function(int, double) -> int;
They probably want to use the same arrow signature and need something in place of auto as omitting it completely would complicate parsing.

Re: Carbon Language: An experimental successor to C++

#17
post #6

It's become a pet peeve of mine, but for the love of God, if anyone with input in Carbon is scanning this, what can be done to use "func" instead of "fn" as a keyword? That all-consonant keyword always makes it seem like I'm reading Hungarian notation when reading Rust for instance. An other options I've seen for instance in Pony, "fun", is already an English word with a completely different meaning. Even the "functi…

I use emacs' prettify-symbol mode to turn every language's function keyword into ʩ. Don't think I incurred in God's wrath just yet.

Re: Carbon Language: An experimental successor to C++

#18

Earlier quoted context omitted.

It's an ongoing project, specifying a date here wouldn't make much sense.

is there any news? the website has no information and doesn't really highlight anything other than their launch at a conference in 2022.

The information is scattered around the Wiki, LLVM and C++ related conferences.

Basically there should be a 1.0 somehow towards the end of 2026.

https://github.com/carbon-language/carbon-lang/blob/trunk/do...

This is a talk from last year CppNorth, there should be one this year as well,

https://youtu.be/8SGMy9ENGz8?si=reukeBjxAOivX6qI

Re: Carbon Language: An experimental successor to C++

#19
post #6

It's become a pet peeve of mine, but for the love of God, if anyone with input in Carbon is scanning this, what can be done to use "func" instead of "fn" as a keyword? That all-consonant keyword always makes it seem like I'm reading Hungarian notation when reading Rust for instance. An other options I've seen for instance in Pony, "fun", is already an English word with a completely different meaning. Even the "functi…

Tbh, I wonder why modern languages still have a function keyword at all, e.g.: const add = (a: i32, b: i32): i32 => a + b; ...or any variation of the arrow-function idea...

It's hard for a naive parser (one-token lookahead, for example), to tell after parsing `const add = (` if this defines a function or a variable.

A "function" keyword often exists just to help the parser. C3, for example, to simply the parser of its language that's a superset of C, adds a "fn" keyword for this very purpose of disambiguation.

Re: Carbon Language: An experimental successor to C++

#20
post #6

It's become a pet peeve of mine, but for the love of God, if anyone with input in Carbon is scanning this, what can be done to use "func" instead of "fn" as a keyword? That all-consonant keyword always makes it seem like I'm reading Hungarian notation when reading Rust for instance. An other options I've seen for instance in Pony, "fun", is already an English word with a completely different meaning. Even the "functi…

I like it the most when there's no keyword. Just name() and return type.
Post reply on HN