== Clone of https://github.com/carbon-language/carbon-lang.git ==

Nicholas Bishop 2445ad9703 Prevent `ref self` methods from being called from C++ with an rvalue (#7130) 3 päivää sitten
.agents 327cb2396a Add a Bazel skill (#7061) 2 viikkoa sitten
.github 0e308e0739 Switch to a manual check status for dependent PRs (#7117) 4 päivää sitten
.vscode 19660ccde0 Add lldbinit.py to the lldb launch command for VSCode (#6447) 5 kuukautta sitten
bazel 8cd659ee09 Switch to a "manual" tags and use them more pervasively (#7102) 1 viikko sitten
common df6a5a50dc Remove the `Dump` method from `Printable` (#7118) 6 päivää sitten
core 05ba1d7356 Add a conversion impl from `T*` to `const T*` (#7010) 4 viikkoa sitten
docs cd6ab7ce8e Switch jj settings to 'jj config set' because of repo (#7007) 1 kuukausi sitten
examples 2787089247 Switch to a Bazel-based runtimes build, and add bootstrapping (#6989) 1 kuukausi sitten
github_tools 7bb86bad66 Dependent PR workflow: don't crash if `first_commit` is `null`. (#7137) 4 päivää sitten
proposals 4a0c1ddd8e Identification of a named constraint during definition (#6902) 1 kuukausi sitten
scripts 96529e16bd Fully switch to the new compilation database system (#7057) 2 viikkoa sitten
testing fbe917b949 Create a UnifiedDiffMatcher to make golden test failures easier to understand (#6897) 1 kuukausi sitten
third_party b16cde9c53 Add a hack to support `-cc1as`. (#7083) 1 viikko sitten
toolchain 2445ad9703 Prevent `ref self` methods from being called from C++ with an rvalue (#7130) 3 päivää sitten
utils 680fa0c990 Force updating the `uuid` dependency of vscode (#7109) 1 viikko sitten
website 9f1a0c816c Bump addressable from 2.8.7 to 2.9.0 in /website in the bundler group across 1 directory (#7037) 3 viikkoa sitten
.bazelignore 53c257d2e2 Switch libpfm and boost.unordered to BCR versions (#6847) 1 kuukausi sitten
.bazelrc bab35c114e Remove the leading `/proc/self/cwd/` from file paths in the debug info. (#7060) 2 viikkoa sitten
.bazelversion 9532effeae Update to the latest Bazel 8 release and latest Bazel modules (#7111) 1 viikko sitten
.clang-format aec2534e9d Fix formatting of compound-type variable declarations in macros (#6997) 1 kuukausi sitten
.clang-tidy 51e843d904 Suppress some clang-tidy false positives (#7131) 4 päivää sitten
.clangd 12cdd406b0 Factor type lowering out of file_context.cpp. (#7099) 1 viikko sitten
.codespell_ignore 9704dc670e Change the Destroy blanket impls to be more specific (#6098) 7 kuukautta sitten
.gdbinit ccf51cef23 Update to bazel 8.0.0 (#4729) 1 vuosi sitten
.gitattributes ad84e71acd Avoid non-UTF8-encoded test files. (#5965) 8 kuukautta sitten
.gitignore 7d97389642 Add `.swp` vim file name to the .gitignore (#6693) 2 kuukautta sitten
.lldbinit c3e112e664 Document and configure running lldb from the command line (#5324) 1 vuosi sitten
.pre-commit-config.yaml 0e308e0739 Switch to a manual check status for dependent PRs (#7117) 4 päivää sitten
.prettierrc.yaml b5368b3078 Change prettier to a direct node use. (#4550) 1 vuosi sitten
.python-version f03bd6a89b Set `.python-version` to 3.10 for pyenv users (#4456) 1 vuosi sitten
AGENTS.md 327cb2396a Add a Bazel skill (#7061) 2 viikkoa sitten
BUILD d6a741f208 Add bootstrapping flags to the build system (#7084) 1 viikko sitten
CODEOWNERS f27ccbf76e Add CODEOWNERS for review assignment (#6153) 7 kuukautta sitten
CODE_OF_CONDUCT.md d1c6f0152e Update CODE_OF_CONDUCT.md (#4441) 1 vuosi sitten
CONTRIBUTING.md 9ed045ec25 Add a link to the docs on testing the toolchain to CONTRIBUTING.md (#6981) 1 kuukausi sitten
LICENSE 7e81d1c213 Fix typo 'langauge'. 5 vuotta sitten
MODULE.bazel 9532effeae Update to the latest Bazel 8 release and latest Bazel modules (#7111) 1 viikko sitten
MODULE.bazel.lock 9532effeae Update to the latest Bazel 8 release and latest Bazel modules (#7111) 1 viikko sitten
README.md c860c178d4 Add 2025 conference talks to the README and note some upcoming ones in 2026 (#6689) 2 kuukautta sitten
SECURITY.md 25b85a55ae Remove myself from SECURITY.md (#6964) 1 kuukausi sitten
bazel-execroot 6204a27ea9 Start adapting to bzlmod configurations. (#3505) 2 vuotta sitten
pyproject.toml 1e9708e2cc Update python version for black (#6877) 1 kuukausi sitten
setup.cfg 24bea76c3e Move mypy config to setup.cfg (#1239) 4 vuotta sitten
version_base.bzl b51dc7f8e2 Introduce version and build info stamping. (#4054) 1 vuosi sitten

README.md

Carbon Language:
An experimental successor to C++

Why? | Goals | Status | Getting started | Join us

See our announcement video from CppNorth. Note that Carbon is not ready for use.

<img src="docs/images/quicksort_snippet.svg" align="right" width="575"

 alt="Quicksort code in Carbon. Follow the link to read more.">

Fast and works with C++

  • Performance matching C++ using LLVM, with low-level access to bits and addresses
  • Interoperate with your existing C++ code, from inheritance to templates
  • Fast and scalable builds that work with your existing C++ build systems

Modern and evolving

  • Solid language foundations that are easy to learn, especially if you have used C++
  • Easy, tool-based upgrades between Carbon versions
  • Safer fundamentals, and an incremental path towards a memory-safe subset

Welcoming open-source community

  • Clear goals and priorities with robust governance
  • Community that works to be welcoming, inclusive, and friendly
  • Batteries-included approach: compiler, libraries, docs, tools, package manager, and more

Why build Carbon?

C++ remains the dominant programming language for performance-critical software, with massive and growing codebases and investments. However, it is struggling to improve and meet developers' needs, as outlined above, in no small part due to accumulating decades of technical debt. Incrementally improving C++ is extremely difficult, both due to the technical debt itself and challenges with its evolution process. The best way to address these problems is to avoid inheriting the legacy of C or C++ directly, and instead start with solid language foundations like modern generics system, modular code organization, and consistent, simple syntax.

Existing modern languages already provide an excellent developer experience: Go, Swift, Kotlin, Rust, and many more. Developers that can use one of these existing languages should. Unfortunately, the designs of these languages present significant barriers to adoption and migration from C++. These barriers range from changes in the idiomatic design of software to performance overhead.

Carbon is fundamentally a successor language approach, rather than an attempt to incrementally evolve C++. It is designed around interoperability with C++ as well as large-scale adoption and migration for existing C++ codebases and developers. A successor language for C++ requires:

  • Performance matching C++, an essential property for our developers.
  • Seamless, bidirectional interoperability with C++, such that a library anywhere in an existing C++ stack can adopt Carbon without porting the rest.
  • A gentle learning curve with reasonable familiarity for C++ developers.
  • Comparable expressivity and support for existing software's design and architecture.
  • Scalable migration, with some level of source-to-source translation for idiomatic C++ code.

With this approach, we can build on top of C++'s existing ecosystem, and bring along existing investments, codebases, and developer populations. There are a few languages that have followed this model for other ecosystems, and Carbon aims to fill an analogous role for C++:

  • JavaScript → TypeScript
  • Java → Kotlin
  • C++ → Carbon

Language Goals

We are designing Carbon to support:

  • Performance-critical software
  • Software and language evolution
  • Code that is easy to read, understand, and write
  • Practical safety and testing mechanisms
  • Fast and scalable development
  • Modern OS platforms, hardware architectures, and environments
  • Interoperability with and migration from existing C++ code

While many languages share subsets of these goals, what distinguishes Carbon is their combination.

We also have explicit non-goals for Carbon, notably including:

Our detailed goals document fleshes out these ideas and provides a deeper view into our goals for the Carbon project and language.

Project status

Carbon Language is currently an experimental project. We are hard at work on a toolchain implementation with compiler and linker. You can try out the current state at compiler-explorer.com.

We want to better understand whether we can build a language that meets our successor language criteria, and whether the resulting language can gather a critical mass of interest within the larger C++ industry and community.

Currently, we have fleshed out several core aspects of both Carbon the project and the language:

  • The strategy of the Carbon Language and project.
  • An open-source project structure, governance model, and evolution process.
  • Critical and foundational aspects of the language design informed by our experience with C++ and the most difficult challenges we anticipate. This includes designs for:
    • Generics
    • Class types
    • Inheritance
    • Operator overloading
    • Lexical and syntactic structure
    • Code organization and modular structure
  • An under-development compiler and toolchain that will compile Carbon (and eventually C++ code as well) into standard executable code. This is where most of our current implementation efforts are directed.
    • Historically, there was also a prototype explorer interpreter that implemented an older version of the Carbon language design, but is no longer under development and has been archived.

If you're interested in contributing, we're currently focused on developing the Carbon toolchain until it can support Carbon ↔ C++ interop. Beyond that, we plan to continue developing the design and toolchain until we can ship the 0.1 language and support evaluating Carbon in more detail.

You can see our full roadmap for more details.

Carbon and C++

If you're already a C++ developer, Carbon should have a gentle learning curve. It is built out of a consistent set of language constructs that should feel familiar and be easy to read and understand.

The Carbon code here is hypothetical and meant to show the look and feel of the language.

C++ code like this:

<img src="docs/images/cpp_snippet.svg" width="600"

 alt="A snippet of C++ code. Follow the link to read it.">

corresponds to this Carbon code:

<img src="docs/images/carbon_snippet.svg" width="600"

 alt="A snippet of converted Carbon code. Follow the link to read it.">

You can call Carbon from C++ without overhead and the other way around. This means you migrate a single C++ library to Carbon within an application, or write new Carbon on top of your existing C++ investment. For example:

<img src="docs/images/mixed_snippet.svg" width="600"

 alt="A snippet of mixed Carbon and C++ code. Follow the link to read it.">

Read more about C++ interop in Carbon.

Beyond interoperability between Carbon and C++, we're also planning to support migration tools that will mechanically translate idiomatic C++ code into Carbon code to help you switch an existing C++ codebase to Carbon.

Generics

Carbon provides a modern generics system with checked definitions, while still supporting opt-in templates for seamless C++ interop. Checked generics provide several advantages compared to C++ templates:

  • Generic definitions are fully type-checked, removing the need to instantiate to check for errors and giving greater confidence in code.
    • Avoids the compile-time cost of re-checking the definition for every instantiation.
    • When using a definition-checked generic, usage error messages are clearer, directly showing which requirements are not met.
  • Enables automatic, opt-in type erasure and dynamic dispatch without a separate implementation. This can reduce the binary size and enables constructs like heterogeneous containers.
  • Strong, checked interfaces mean fewer accidental dependencies on implementation details and a clearer contract for consumers.

Without sacrificing these advantages, Carbon generics support specialization, ensuring it can fully address performance-critical use cases of C++ templates. For more details about Carbon's generics, see their design.

In addition to easy and powerful interop with C++, Carbon templates can be constrained and incrementally migrated to checked generics at a fine granularity and with a smooth evolutionary path.

Memory safety

Safety, and especially memory safety, remains a key challenge for C++ and something a successor language needs to address.

We plan to support a two step migration process:

  1. Highly automated, minimal supervision migration from C++ to a dialect of Carbon designed for C++ interop and migration.
  2. Incremental refactoring of the Carbon code to adopt memory-safe designs, patterns, and APIs.

We also want to address important, low-hanging fruit in the safety space immediately when migrating into Carbon:

  • Tracking uninitialized states better, increased enforcement of initialization, and hardening against initialization bugs when needed.
  • Designing fundamental APIs and idioms to support dynamic bounds checking.
  • Switching from undefined behavior to erroneous behavior wherever possible, and marking the remaining undefined behavior with visible unsafe syntax.
  • Having a default debug build mode that has less runtime overhead while being more comprehensive than existing C++ debug build modes combined with Address Sanitizer.

For more details, see our safety design.

Getting started

To try out Carbon immediately in your browser, you can use the toolchain at: carbon.compiler-explorer.com.

We are developing a traditional toolchain for Carbon that can compile and link programs. However, Carbon is still an early, experimental project, and so we only have very experimental nightly releases of the Carbon toolchain available to download, and only on limited platforms. If you are using a recent Ubuntu Linux or similar (Debian, WSL, etc.), you can try these out by going to our releases page and download the latest nightly toolchain tar file: carbon_toolchain-0.0.0-0.nightly.YYYY.MM.DD.tar.gz. Then you can try it out:

# A variable with the nightly version from yesterday:
VERSION="$(date -d yesterday +0.0.0-0.nightly.%Y.%m.%d)"

# Get the release
wget https://github.com/carbon-language/carbon-lang/releases/download/v${VERSION}/carbon_toolchain-${VERSION}.tar.gz

# Unpack the toolchain:
tar -xvf carbon_toolchain-${VERSION}.tar.gz

# Create a simple Carbon source file:
echo "import Core library \"io\"; fn Run() { Core.Print(42); }" > forty_two.carbon

# Compile to an object file:
./carbon_toolchain-${VERSION}/bin/carbon compile \
  --output=forty_two.o forty_two.carbon

# Install minimal system libraries used for linking. Note that installing `gcc`
# or `g++` for compiling C/C++ code with GCC will also be sufficient, these are
# just the specific system libraries Carbon linking still uses.
sudo apt install libgcc-11-dev

# Link to an executable:
./carbon_toolchain-${VERSION}/bin/carbon link \
  --output=forty_two forty_two.o

# Run it:
./forty_two

As a reminder, the toolchain is still very early and many things don't yet work. Please hold off on filing lots of bugs: we know many parts of this don't work yet or may not work on all systems. We expect to have releases that are much more robust and reliable that you can try out when we reach our 0.1 milestone.

If you want to build Carbon's toolchain yourself or are thinking about contributing fixes or improvements to Carbon, you'll need to install our build dependencies (Clang, LLD, libc++) and check out the Carbon repository. For example, on Debian or Ubuntu:

# Update apt.
sudo apt update

# Install tools.
sudo apt install \
  clang \
  libc++-dev \
  libc++abi-dev \
  lld

# Download Carbon's code.
$ git clone https://github.com/carbon-language/carbon-lang
$ cd carbon-lang

Then you can try out our toolchain which has a very early-stage compiler for Carbon:

# Build and run the toolchain's help to get documentation on the command line.
$ ./scripts/run_bazelisk.py run //toolchain -- help

For complete instructions, including installing dependencies on various different platforms, see our contribution tools documentation.

Learn more about the Carbon project:

Conference talks

Carbon focused talks from the community:

2026

  • Benchmarking and optimizing the Carbon compiler, NDC {Toronto} (May 5-8)
  • Carbon: graduating from the experiment, NDC {Toronto} (May 5-8)

2025

  • Carbon: from C++ to Memory Safety, REBASE - ICFP/SPLASH (slides)
  • Memory safety everywhere with both Carbon and Rust, RustConf (video, slides)

2024

  • Generic implementation strategies in Carbon and Clang, LLVM Developers' Meeting (video, slides)
  • The Carbon Language: Road to 0.1, NDC {TechTown} (video, slides)
  • How designing Carbon with C++ interop taught me about C++ variadics and overloads, CppNorth (video, slides)
  • Generic Arity: Definition-Checked Variadics in Carbon, C++Now (video, slides)
  • Carbon: An experiment in different tradeoffs, panel session, EuroLLVM (video, slides)
  • Carbon's high-level semantic IR lightning talk, EuroLLVM (video)

2023

  • Carbon’s Successor Strategy: From C++ interop to memory safety, C++Now (video, slides)
  • Definition-Checked Generics, C++Now
  • Modernizing Compiler Design for Carbon’s Toolchain, C++Now (video, slides)

2022

  • Carbon Language: Syntax and trade-offs, Core C++ (video, slides)
  • Carbon Language: An experimental successor to C++, CppNorth (video, slides)

Other videos

We additionally have toolchain videos.

Join us

We'd love to have folks join us and contribute to the project. Carbon is committed to a welcoming and inclusive environment where everyone can contribute.

Contributing

You can also directly:

You can check out some "good first issues", or join the #contributing-help channel on Discord. See our full CONTRIBUTING documentation for more details.