Carbon, Google’s latest programming language, was announced today as an experimental successor to C++.
Today, at the Cpp North Convention in Toronto, as shared by Conor Hoekstra who was in attendance and documenting the slides, Googler Chandler Carruth shared the vision of a new programming language called Carbon. To provide the framework, Carruth showed how many of today’s most popular programming languages have descendants that allow developers to be productive quickly and also take advantage of modern language design.
While some have suggested that Rust, originally a Mozilla project that now has a significant public following, is a successor to C++, Carruth wonders if the analogy still holds. While Rust is undoubtedly a great language to start a new project, it doesn’t have the same “two-way interoperability” as Java and Kotlin, making continuous migration difficult.
If Rust works for you today, you should use it. But moving a C++ ecosystem to Rust is difficult.
To that end, while Carbon shares many of the same goals as Rust, such as helping developers create “performance-critical software,” Carbon is also intended to be fully interoperable with existing C++ code. Additionally, the goal is to make migrating from C++ to Carbon as easy as possible, if desired.
As for why a C++ developer might want to consider introducing carbon into their codebase, Carruth shared some highlights of the language on stage.
- Introductory keywords and a simple grammar
- Function input parameters are read-only values
- Pointers provide indirect access and mutation
- Use expressions to name types
- The package is the root namespace
- Import APIs by their package name
- Explicit object parameters declare a method
- Simple inheritance; Classes are final by default
- Powerful, definition-tested generics
- Types implement interfaces explicitly
Beyond the features of the language, the Carbon team drew attention to the development process that will shape the future of Carbon. The project’s code is hosted publicly on GitHub and is open to pull requests, while Carbon’s culture is outlined to be accessible and inclusive to corporate and individual employees alike.
However, one aspect of the Carbon programming language that isn’t particularly well outlined is Google’s involvement. While today’s presentation was shared by a Google employee, and the current project leaders for Carbon are mostly – but not exclusively – Google employees, Carbon is not otherwise mentioned as a Google project.
This is actually by design, because while Carbon got its start at Google, the team understands and has shared online that to be successful in the future, Carbon needs to be “an independent and community-driven project, and not just from Google’s own uses.” is driven . In the same comment, Carruth further emphasizes that carbon is currently only an experiment, in which some companies have shown interest early on.
If you are interested in getting started with Carbon, you can download the source code and experiment with it on your own device. Or you can get a feel for the Carbon programming language right in your browser thanks to integration with the free Compiler Explorer web app.
A previous version of this article incorrectly stated that all of Carbon’s leads are Google employees. We apologize for the error.
FTC: We use income earning auto affiliate links. More.
Visit 9to5Google on YouTube for more news: