Don’t Get Burned by Google Carbon
Should you jump in and play with the new programming language, Carbon, from Google or wait?
--
Carbon is the hot new thing, but you might want to think twice before sinking a lot of time into Carbon. This language is in an extremely early stage. There is no actual compiler or toolchain. The language specification is far from done. All we have at the moment is language specification under heavy development and an interpreter of the language called Explorer. The interpreter can run Carbon code by interpreting it. Its other primary purpose is to represent the abstract syntax tree of Carbon code.
If you wish you can install the Explorer by using Homebrew package manager. However that will probably not work on Windows. The Carbon team provides install instructions:
❯ brew install bazelisk
❯ brew install llvm
❯ export PATH="$(brew --prefix llvm)/bin:${PATH}"
❯ git clone https://github.com/carbon-language/carbon-lang
❯ cd carbon-lang❯ bazel run //explorer -- ./explorer/testdata/print/format_only.carbon
These instructions work for Bourn Again Shell bash
and Z Shell zsh
, but for those of you who use Fish Shell fish
, like me, you would want to export the PATH
variable slightly different:
❯ set -x PATH (brew --prefix llvm)/bin $PATH
For Windows you might want to try to install Bazelisk using Choco instead.
❯ choco install bazelisk
Your first question is probably: What the heck is Bazelisk and Bazel? We can look at what the Bazel project says about themselves:
Bazel is an open-source build and test tool similar to Make, Maven, and Gradle. It uses a human-readable, high-level build language. Bazel supports projects in multiple languages and builds outputs for multiple platforms. Bazel supports large codebases across multiple repositories, and large numbers of users.
Bazelisk is just a friendly wrapper around Bazel written in Go:
Bazelisk is a wrapper for Bazel written in Go. It automatically picks a good version of Bazel given your current working directory, downloads it from the official server (if required) and then transparently passes…