TIDE
Languages

Carbon

Installing Carbon on Ubuntu in TIDE

Carbon

Carbon is an experimental, fast, memory-safe successor language to C++ created by Google.

Installation

You can install build dependencies and download pre-built toolchains or build Carbon using Bazel on Ubuntu.

Install essential build tools:

apt update
apt install -y build-essential clang libc++-dev libc++abi-dev lld curl git

Download the pre-compiled nightly toolchain from GitHub releases or build via Bazelisk:

curl -fsSL https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 -o /usr/local/bin/bazel
chmod +x /usr/local/bin/bazel

Clone the Carbon repository:

git clone https://github.com/carbon-language/carbon-lang.git
cd carbon-lang

Hello World Example

Create a file named hello.carbon:

hello.carbon
package Main api;

fn Main() -> i32 {
  Print("Hello, TIDE!");
  return 0;
}

Running the Code

Run the Carbon interpreter using Bazel inside the repository:

bazel run //explorer -- hello.carbon

Official Resources

On this page