HOME

TheInfoList



OR:

Carbon, or Carbon-Lang, is an experimental,
general-purpose programming language In computer software, a general-purpose programming language (GPL) is a programming language for building software in a wide variety of application domains. Conversely, a domain-specific programming language is used within a specific area. For exam ...
. The project is open-source and was started by
Google Google LLC () is an American Multinational corporation, multinational technology company focusing on Search Engine, search engine technology, online advertising, cloud computing, software, computer software, quantum computing, e-commerce, ar ...
, 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 Toronto ( ; or ) is the capital city of the Canadian province of Ontario. With a recorded population of 2,794,356 in 2021, it is the most populous city in Canada and the fourth most populous city in North America. The city is the anch ...
in July 2022. He stated that Carbon was created to be a
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
successor. The language is expected to have a 1.0 release in 2024 or 2025. The language intends to fix several perceived shortcomings of C++ but otherwise provides a similar feature set. The main goals of the language are readability and "bi-directional interoperability", as opposed to using a new language like
Rust Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO( ...
(which, while being influenced by C++, is not two-way compatible with C++ programs). Changes to the language will be decided by the Carbon leads. Carbon's documents, design, implementation, and related tools are hosted on
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continu ...
under the Apache-2.0 license with
LLVM LLVM is a set of compiler and toolchain technologies that can be used to develop a front end for any programming language and a back end for any instruction set architecture. LLVM is designed around a language-independent intermediate repre ...
Exception.


Example

The following shows how a
"Hello, World!" program A "Hello, World!" program is generally a computer program that ignores any input and outputs or displays a message similar to "Hello, World!". A small piece of code in most general-purpose programming languages, this program is used to illustr ...
is written in Carbon: package Sample api; fn Main() -> i32 The following is the equivalent "Hello, World!" program written in C++: #include int main()


See also

*
Comparison of programming languages Programming languages are used for controlling the behavior of a machine (often a computer). Like natural languages, programming languages follow the rules for syntax and semantics. There are thousands of programming languages and new ones are c ...
* Timeline of programming languages *
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
* D *
Rust Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO( ...


References


External links


Carbon at the Compiler Explorer (godbolt)
Google Programming languages Statically typed programming languages Cross-platform software Object-oriented programming languages {{Google-stub