Google engineer Chandler Carruth recently announced at the CppNorth conference in Toronto, officially open-sourcing Google’s internally built programming language: Carbon. He also called Carbon the successor to C++ (which is currently in the experimental stage).
Chandler also mentions Rust, which is also initially billed as a successor to C++, but the relationship is not as “bi-directional interoperability” as Java and Kotlin, making it difficult to migrate consistently. As for Carbon, it shares many of the same goals as Rust and supports full interoperability with existing C++ code, with the goal of making it as easy as possible for developers to migrate from C++ to Carbon.
- Introducer keyword and simple syntax
- Function input parameters are read-only values
- Pointer provides indirect access and variants
- Use expressions to name types
- Package as root namespace
- API import by package name
- Method declaration with explicit object arguments
- Single inheritance, default use of final class
- Powerful and definition-checked generics
- Types can explicitly implement interfaces
C++ code versus Carbon code.
The code for the Carbon language is currently fully open source. Chandler says that while Carbon was born from within Google and its current project leaders are largely (not entirely) made up of Google employees, it aims to be an “independent and community-driven open source project.”
If you are interested in Carbon, you can download the source code and experiment with it on your own device, or experience the Carbon programming language directly in your browser via Compiler Explorer to experience the Carbon programming language directly in your browser.
Some background information on the Carbon project was revealed by a developer: In February 2020, the C++ standards committee voted on a proposal to “break ABI compatibility for performance”, an effort largely driven by Google employees, but the vote ultimately failed. As a result, many Google employees have stopped participating in C++ standardization efforts, resigned their official positions on the committee, and clang development has slowed considerably. Based on this background and the goals Google has set for Carbon, this developer believes that Google really wants to make Carbon a replacement for C++.