![]() Logo on Carbon's GitHub organization | |
Family | C |
---|---|
Designed by | |
Typing discipline | Static, nominative, partly inferred |
Implementation language | C++ |
License | Apache-2.0-with-LLVM-Exception |
Filename extensions | .carbon |
Website | github |
Influenced by | |
C++, Rust, Go |
Carbon, or Carbon-Lang, is an experimental, general-purpose programming language. The project is open-source and was started by Google, following in the footsteps of previous Google-made programming languages (Go and Dart). Google engineer Chandler Carruth first introduced Carbon at the CppNorth conference in Toronto in July 2022. He stated that Carbon was created to be a C++ successor.[1][2][3] The language is expected to have a 1.0 release in 2024 or 2025.[4]
The language intends to fix several perceived shortcomings of C++[5] but otherwise provides a similar feature set. The main goals of the language are readability and "bi-directional interoperability" (which allows the user to include C++ code in the Carbon file), as opposed to using a new language like Rust, that, while being influenced by C++, is not two-way compatible with C++ programs. Changes to the language will be decided by the Carbon leads.[6][7][8][9]
Carbon's documents, design, implementation, and related tools are hosted on GitHub under the Apache-2.0 license with LLVM Exceptions.[10]
The following shows how a "Hello, World!" program is written in Carbon:
package Sample api;
fn Main() -> i32 {
var s: auto = "Hello, World!";
Print(s);
return 0;
}
The following is the equivalent "Hello, World!" program written in C++:
#include <iostream>
int main() {
auto s = "Hello, World!";
std::cout << s;
return 0;
}
Google free and open-source software | |||||||||
---|---|---|---|---|---|---|---|---|---|
Software |
| ||||||||
Related |