Home The Carbon language - what are its authors silent about? 🕵️
Post
Cancel

The Carbon language - what are its authors silent about? 🕵️

Many have already heard about the Carbon language, which Google presents as a “successor of C++”. In just a few days, people gave it 16k stars on GitHub.

We can observe it from three points of view: (1) why it is being made, (2) what is planned in it, (3) what can happen next.

🤔 Why is it being made?

According to the authors, the main problem of C++ is the huge complexity of making changes to it.

This is correct - the C++ Standard Committee suffers from bureaucracy, is limited by rigid limits, and in fact most of the proposals are thrown into the trash for all sorts of reasons (this can be described in a separate post).

The final butthert happened in February 2020, when the Committee refused to break the ABI (you can read more about this there), then it became clear that C++ would continue to evolve at a snail’s pace, so Google began to secretly create its own C++ 2.0

🤔 What is planned in it?

The most important thing is that C++ and Carbon can include each other’s headers, that is, there is bidirectional language compatibility (as between Java and Kotlin). I suspect that this is done through a Clang patch, so when it sees a file with the right extension, parses it into an intermediate representation in the right way, and then everything is optimized together.

There is documentation on GitHub, which is already so big that it could fit in a small book. I was amazed at the volume of what the authors are planning 🤐, for example:

  • Around the language: a package manager, a strong standard library (if it will be something like Python, then it will be crazy), a fast “standardization” process, and so on…
  • The language itself: pattern matching (like in Rust), reflection (there are no docks yet, but I suppose there will be), traits (also like in Rust), working with types, memory safety in the future, and so on…
  • Little things: an adequate inheritance hierarchy, classes are final by default, checking for NRVO, and so on…

🤔 What is next?

Here I will outline the facts in which I am pretty sure, and you can make a conclusions based on them 👻

  • Google has giant resources to promote any language “needed by the party to the masses”: advertising at C++ conventions, mass release of courses (for example, on Coursera), training at universities… So, if desired, the language can be promoted in “non-market” ways (for example, it is unlikely that the Go language would gain wide popularity without heavy promoting).
  • Google has technical resources to create C++ 2.0 without messing it up, because a lot of very active contributors to Clang and the C++ Standard work at Google.
  • The saddest thing is that the “economics” of C++ and Carbon development will be radically different.

The fact is that people who contribute in C++ are mainly “ascets”, they are not interested in money for their contribution or whatever. They don’t have the deadline for standardizing or implementing a feature. But Carbon is being developed by a corporation.

When working in FAANG (or in one of dozens of companies cosplaying them), it’s not how you do it that matters, but what you do. Who’s getting a promotion? All other things being equal, it’s usually not a dude who knows C++ cool, solves tasks well and covers them with tests, but someone who released out some crap with high visibility and showed beautiful graphics to the promotion committee. Usually no one will care if there are no tests or the code is shitty - it has released, well, that’s good.

Therefore, there is a risk that because of someone’s plan to “release out something “kinda cool”, show this to the manager, and get a promotion” Carbon may evolve into some kind of undesirable mess.

This post is licensed under CC BY 4.0 by the author.

Story of Alexander Stepanov, the author of STL 🔆

📚 Book review: "The Small C handbook" (1984)