# Wednesday, 10 July 2024

Things are really starting to happen on the Carbon project. Since Chandler Carruth announced the project two years ago at CppNorth, progress on the language design, and the toolchain implementation, has been considerable. Until very recently, if you wanted to try your hand at writing a little "hello world" application, you literally had to clone or fork the repo, and then build all the toolchain and tests, and you had to install a lot of dependencies in order to do that.

Now, there are nightly releases of a tool that can compile and link Carbon code. The only dependency I needed (on a WSL Ubuntu fresh install) was clang-16. I got that like this:

wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 16
sudo apt install \
  clang-16 \
  libc++-16-dev  \
  libc++abi-16-dev \
  lld-16

Then I downloaded a nightly build, untar-ed it, and could compile and link Carbon code, within the limitations of what has been implemented so far.

If you haven't been paying attention, you might want to watch some conference talks. Or check out the Carbon Copy newsletter. You'll find the 3 issues that have been published in the announcements section of the repo. Issue Number 3 is the latest and includes sample code that runs the Sieve of Eratosthenes to count the number of primes under 1000. (You can edit it to try a different limit, if you like.) This shows off user defined types (with a factory function), while loops, if, and a number of other parts of the language. 

Of course, Carbon is nowhere near ready to use. The only UI it can do is to print an integer. No other types, and it can't read input. There are no strings. There's no C++ interop. A number of language features (generics, variadics, lambdas and so on) are not implemented. It is nearly ready to evaluate. If you can't wait to start evaluating, you don't have to. Just be aware you can't evaluate all of it yet. But you can start, if you would like to.

Kate


Wednesday, 10 July 2024 14:17:13 (Eastern Daylight Time, UTC-04:00)  #