Description #
Carbon is an experimental compiled programming language proposed by Google as a potential successor to C++. It aims to offer a modern developer experience while maintaining C++ interoperability and high performance.
History #
Carbon was unveiled in July 2022 at CppNorth by Google engineer Chandler Carruth. It was created to address long-standing issues with C++ such as complexity, slow evolution, and legacy constraints. Rather than replacing C++, Carbon is designed as a gradual migration path, providing safety, modern syntax, and improved tooling while remaining interoperable with existing C++ codebases.
Hello World Code #
package sample api;
fn Main() -> i32 {
Print("Hello, World!");
return 0;
}
How to Run #
Option 1: Online
https://godbolt.org/z/Txj5T1Pvs (Carbon in Compiler Explorer)
Option 2: Local
- Carbon is still experimental and not yet production-ready
- Build instructions are available at the GitHub repo:
https://github.com/carbon-language/carbon-lang
Key Concepts #
- Syntax style: Modern C-style with clear, minimal keywords
- Typing discipline: Static, safe-by-default
- Execution model: Compiled via LLVM to native machine code
- Common use cases: Systems programming, performance-critical applications (future goal)
- Toolchain or ecosystem: LLVM-based toolchain (under development)
- Paradigms supported: Multi-paradigm, mainly imperative and object-oriented
- Compilation details: Compiles to intermediate representation using LLVM
- Strengths or quirks: Interoperability with C++, safe defaults, clearer syntax
- Libraries/frameworks: Not yet available — early stage
- Community/adoption: Early experimental phase; open-source with growing interest
Try It Online #
https://godbolt.org (search Carbon under language dropdown)
Fun Facts #
Carbon’s tagline is “a successor language to C++.” It’s intentionally designed to be familiar to C++ developers, yet aims to remove decades of accumulated complexity. The project is community-driven and open to contributors via GitHub.