Live data from Hacker News

Carbon Language: An experimental successor to C++

github.com

11–20 of 521 posts

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

#11
Looks like this experiment has been going on for a couple of years, a bunch of familiar (internet-familiar, have met Chandler a couple of times but do not know any personally) names were secretly working on it, and it was only made public a few days ago:

https://github.com/carbon-language/carbon-lang/pull/1363

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

#12
It seems that the goal is a new language with full interop with C++, kind of like Zig's interop with C.

- I wonder how much baggage had to be maintained for interop. If some of it could be isolated, how did they do it?

- Does this fall into any of the traps that D initially did where it allowed C interop but was, by default, more limited in what C environments it could run in or is this as flexible as C++ for environments?

As for the language itself, I've not had a chance to dig into it too much but I am sad to see that it uses explicit local inference by replacing the type name with `auto` rather than eliding the type completely [0]. While it has its pains at times, this is something I've come to enjoy in Rust.

I also didn't see mention of tooling. Having out-of-the-box build, test, and code formatting would be a big help for establishing community standards / practices, even if the build/test tool might get limited when having to do C++ interop. At least for pure-Carbon libraries it would be a big help!

> Once we can migrate code into Carbon, we will have a simplified language with room in the design space to add any necessary annotations or features, and infrastructure like generics to support safer design patterns. Longer term, we will build on this to introduce a safe Carbon subset. This will be a large and complex undertaking, and won't be in the 0.1 design. Meanwhile, we are closely watching and learning from efforts to add memory safe semantics onto C++ such as Rust-inspired lifetime annotations.

I'm a bit skeptical if they push off lifetime annotations too far.

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

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

#13
post #5
post #3

I was interested and intrigued, but then: // A dynamically sized array, like `std::vector`. var circles: Array(Circle) = ({.r = 1.0}, {.r = 2.0}); Yegads, they've put effort into ensuring API and ABI compatibility with C++, but they've gone and decided to change the meaning of nouns for basic types?! Why, just why would introducing that obvious footgun be appealing? It raises the concern that the language is full of…

Why is it an obvious footgun?

A developer familiar with C++ may believe it to be a fixed length container (perhaps with automatic bounds checking[0]) and treat it as such in memory/security/performance critical sections.

0: https://en.cppreference.com/w/cpp/container/array/at

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

#15
post #9

It's not immediately obvious from this page and GitHub org, but this is a Google led project. It's led by Chandler and the c++ toolchain team. I have no idea of it's endgoals or how open to non-Google ideas it will be.

> this is a Google led project

This doesn't give me much confidence if its Corporate governance rather than open governance.

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

#16
post #15
post #9

It's not immediately obvious from this page and GitHub org, but this is a Google led project. It's led by Chandler and the c++ toolchain team. I have no idea of it's endgoals or how open to non-Google ideas it will be.

> this is a Google led project This doesn't give me much confidence if its Corporate governance rather than open governance.

The governance of the project is not immediately clear to me, and I have to assume that the Google team is working in good faith. That team cares a lot about C++ and its future. They are obviously aware of this stigma. I also think that Google is pretty bad at open source governance though :/

Disclosure: Former Google engineer who worked sorta adjacent to some of those people.

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

#17
post #7
post #3

I was interested and intrigued, but then: // A dynamically sized array, like `std::vector`. var circles: Array(Circle) = ({.r = 1.0}, {.r = 2.0}); Yegads, they've put effort into ensuring API and ABI compatibility with C++, but they've gone and decided to change the meaning of nouns for basic types?! Why, just why would introducing that obvious footgun be appealing? It raises the concern that the language is full of…

It's std::vector that was weirdly named. In plenty of codebases "Vector", particularly gamedev and scientific, will mean the mathematical object with that name. Other languages don't need to replicate this mistake.

[deleted]

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

#18
post #7
post #3

I was interested and intrigued, but then: // A dynamically sized array, like `std::vector`. var circles: Array(Circle) = ({.r = 1.0}, {.r = 2.0}); Yegads, they've put effort into ensuring API and ABI compatibility with C++, but they've gone and decided to change the meaning of nouns for basic types?! Why, just why would introducing that obvious footgun be appealing? It raises the concern that the language is full of…

It's std::vector that was weirdly named. In plenty of codebases "Vector", particularly gamedev and scientific, will mean the mathematical object with that name. Other languages don't need to replicate this mistake.

True, though in OP's defense I don't know if I've ever seen a language refer to a growing list of entries as an "array".

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

#20
post #15
post #9

It's not immediately obvious from this page and GitHub org, but this is a Google led project. It's led by Chandler and the c++ toolchain team. I have no idea of it's endgoals or how open to non-Google ideas it will be.

> this is a Google led project This doesn't give me much confidence if its Corporate governance rather than open governance.

Nor does it convey any confidence that Google will support it.
Post reply on HN