Source | This article is authorized for reprint by AI new media Quantum Bit (ID: QbitAI). Please contact the source for reprinting.
Author | Alex from Aofeisi
At this year’s CPP North C++ conference, Google announced a new programming language Carbon, claiming it to be the “successor to C++”.
Google has open-sourced it on GitHub. Although the language is still in the experimental stage, it quickly attracted many programmers and even topped the GitHub trending list, currently boasting 21.3k stars.

Regarding Google’s developers calling Carbon the successor to C++, foreign media inquired about the opinion of Bjarne Stroustrup, the father of C++. He stated:
Over the years, there have always been new languages trying to become the successor to C++. I welcome experiments with programming languages and styles;
but Carbon is too new and lacks sufficient specifications, so I cannot make any meaningful technical comments. Typically, without developing entirely new language rules, libraries, and management schemes, it is difficult to provide a viable alternative to C++.
So why is the Google team pursuing a “replacement” for C++ instead of continuing to improve the existing C++? After all, they are widely using this language internally.
Why Not Upgrade C++?
In response, Google engineer Chandler Carruth, who leads the Carbon development team, explained that C++ has been around for 40 years, and many of its inherent issues trouble current developers.
For decades, C++ has accumulated a lot of technical debt. Its maintainers prioritize backward compatibility to continue supporting widely used projects, which can lead to a massive codebase.
Moreover, while C++ has open-source compilers (like gcc), there are also many closed-source compilers, some of whose features may take a long time to improve or upgrade.
Additionally, the development of the C++ language has been hindered by a bureaucratic committee management process that is more focused on standardization than design, making it difficult to add new features.
The best way to address these issues is to avoid directly inheriting the “legacy” of C or C++, and instead start from the fundamentals of the language, such as modern generic systems, modular code organization, and consistent, simple syntax.
Carruth also mentioned at the CPP conference that this language is not intended to compete with future improvements of C++, but rather to—
“Explore What C++ Cannot Do”
Just as Microsoft created TypeScript to update JavaScript, Carbon, as a new language developed on the foundation of C++, aims to solve issues like memory safety and generics for more developers, addressing the shortcomings of C++.

Currently, the highlights of the Carbon language include:
-
Introducer keywords and simple syntax;
-
Function input parameters as read-only values;
-
Pointers providing indirect access and variants;
-
Type naming using expressions;
-
Importing APIs by package name;
-
Powerful and well-defined generics;
-
……
Furthermore, Google is continuing to develop Carbon to support the following features:
-
Performance-critical software;
-
The evolution of software and languages;
-
Code that is easy to read, understand, and write;
-
Practical safety and testing mechanisms;
-
Fast and scalable development;
-
Modern operating system platforms, hardware architectures, and environments;
-
Interoperability and migration with existing C++ code.
The development team will also create a built-in package manager, which is notably lacking in C++.
For example, calculating the area of two circles with radii 1 and 2 using C++ and Carbon code respectively. The comparison is shown in the figure:

△Image source: GitHub; left is C++ code, right is Carbon code
The following image demonstrates the interoperability between Carbon and C++. Programmers can call C++ libraries, methods, and functions in Carbon without additional overhead, and vice versa.

However, regarding safety issues, Carbon does not initially establish a memory safety system.
Carruth explained that due to the poor memory safety of C++, Carbon’s development started from a low point, prioritizing migration over safety; it hopes that in the future, Carbon can at least be as safe as Go or Swift.
In fact, before Carbon, Mozilla (the developer of Firefox) released a language in 2015 that also claimed to be a “successor to C++”: Rust, which emphasizes memory safety.
So why not vigorously develop Rust?
“Carbon is Designed for Those with Extensive C++ Libraries”
Carruth responded at the CPP conference that the interoperability between C++ and Rust is poor, making it very difficult to transition the C++ ecosystem to Rust.
For developers who already have a large C++ codebase, moving their existing work to a Rust editor can be quite cumbersome.
Carbon is designed as a successor language to C++, aiming for seamless integration with C++ and providing bidirectional interoperability, which is very friendly for those with extensive C++ libraries.
For those programmers who do not have such “troubles,” Carruth stated that they can continue using Rust if they wish.
Netizens React
A number of netizens who came to observe Carbon expressed support for Google’s development of this new language:
If it can directly call low-level Stuff functions from C libraries without needing to prepend extern “C”, that would be remarkable.

Some agree with its goals of simplifying the language and enhancing safety, but they feel that improving memory safety within existing languages is not easy, and existing C++ features and APIs may constrain the development of this new language.

Of course, some netizens are skeptical about Carbon, believing that Google has a habit of abandoning innovative software, and this seemingly explosive project may be abandoned midway.

Some also raised the question: How can a language implemented in C++ aim to replace C++?
Some netizens feel that Rust is gradually becoming a low-level programming language, and Carbon and Rust share many similarities; merely “making C++ migration easier” does not present a compelling selling point.

Additionally, on Hacker News, some netizens mentioned the D language (DLang), which has good interoperability with C++. The D language also includes many features of Carbon, such as mutual calls with C++ and reduced overhead.
Unfortunately, due to the unclear initial positioning of the D language, which attempted to cover the functionalities of both Java and C++, it has become relatively niche.

What do you think of Carbon, which claims to be the “successor to C++”? Feel free to leave your comments below~
Portal:https://github.com/carbon-language/carbon-langReference links:[1]https://devclass.com/2022/07/25/c-inventor-stroustrup-says-googles-carbon-too-new-and-under-specified-for-meaningful-technical-comment/[2]https://www.youtube.com/watch?v=omrY53kbVoA[3]https://news.ycombinator.com/item?id=32151609[4] https://www.reddit.com/r/programming/comments/w2thvo/carbon_an_experimental_c_successor_language/


1. Why is the decline of Firefox inevitable?
2. Is it too much to play Go in IDEA?
3. JDK 19 feature set frozen, virtual threads are finally here
4. HTTP/3, it’s here.
5. Can Microsoft escape the domestic rogue software bundle trap? Is it really incompatible?


Click to share

Click to like

Click to view