Open-source · Experimental

A successor language built for C++ developers

Carbon is an experimental successor to C++. It aims for performance matching C++, bidirectional interoperability with existing C++ code, and an incremental path towards a memory-safe subset.

Carbon is not ready for use yet. You can try the toolchain in its current state on Compiler Explorer.

—
GitHub stars
—
Forks
—
Open issues
Apache 2.0
License, with LLVM Exception
hello_world.carbon
import Core library "io";
import Cpp library "hello_world.h";
fn Run() {
Core.PrintStr("Hello world!\n");
Cpp.HelloWorld();
}
hello_world.h
#include <iostream>
inline auto HelloWorld() -> void {
std::cout << "Hello from C++!\n";
}

About the project

Why Carbon?

C++ is hard to improve incrementally, because of both its technical debt and its evolution process. Carbon starts from new foundations instead, and is designed so that a library in an existing C++ stack can adopt it without porting the rest.

C++ interoperability

Designed to call C++ from Carbon and the other way around, from inheritance to templates.

Memory safety

Safer fundamentals, and an incremental path towards a memory-safe subset of the language.

Open evolution

Language changes go through a public evolution process. Anyone who has signed the CLA can comment on proposals.

Contributing

How to get involved

Contributions range from commenting on a proposal to implementing part of the toolchain. Here's a typical path.

01

Read the contributor guide

CONTRIBUTING.md covers CLAs, collaboration tools, the evolution process, and how to say things constructively. Start here before your first PR.

02

Sign the CLA

All contributions require a signed Contributor License Agreement. Individual and corporate CLAs are available; see CONTRIBUTING.md for details.

03

Find a good first issue

Issues labeled good first issue are meant as a starting point. Check that nobody has an open PR for the issue, then start.

04

Open a PR

Follow the pull request workflow. If you get stuck, ask in #contributing-help on Discord.

Ways to help

Questions? Ask in #contributing-help on Discord.

Community

Join the conversation

Most design discussion happens on Discord, and proposals are reviewed on GitHub. You'll need to sign the CLA before posting.

GitHub Discussions

Q&A, longer threads, and the release announcements thread.

Browse discussions →