Member-only story
Learn Google’s Carbon Programming Language — A Tutorial
Know the syntax to get started

According to Google developer Chandler Carruth, Carbon could serve as a successor language to C++.
The documentation declares that Carbon “is designed around interoperability with C++ as well as large-scale adoption and migration for existing C++ codebases and developers”.
This article will provide a practical coding introduction to the Carbon programming language but it won’t discuss why someone might need it.
Getting Started
This Getting Started has two parts: Tooling and Language Basics.
If you have already installed Carbon, feel free to skip to Language Basics, otherwise start with Tooling.
In the Tooling section, we will go over the following to set up our environment:
- Homebrew
- Bazel
- LLVM
- Clone Carbon language
- Run the Explorer
You can find the same approach in Getting Started.
Here, I will just add some context and a brief explanation for the ones who approached the language and the tooling for the first time.
After the installation, we will move forward with some practical examples in the Language Basics section.
Carbon Language: Tooling
1. Homebrew
Homebrew is a package manager that might be already installed on your computer. Run brew --version
to check if you have it already.
If this is not the case, you can install Homebrew on macOS, Linux, and Windows (through WSL).
2. Bazel
Bazel is an open-source build and test tool that scalably supports multi-language and multi-platform projects.
According to the documentation, “Bazel is Carbon’s standard build system. Bazelisk is recommended for installing Bazel”.