miniblog.

← Back to all posts
12
Anthropic used Claude to write a C compiler in Rust (CCC). I've really enjoyed following the discussion. The initial post shows how they wrote the harness with GCC as an oracle and a prompt specifying a design using SSA. The author has clear domain expertise.

12 Comments

Benchmarking showed that CCC has much worse performance in terms of both compile time and runtime. Since it was designed to match gcc flags, it supports both -O0 and -O2, but the output is identical. It produces working code, but it doesn't optimise. https://harshanu.space/en/tech/ccc-vs-gcc/
Benchmarking showed that CCC has much worse performance in terms of both compile time and runtime. Since it was designed to match gcc flags, it supports both -O0 and -O2, but the output is identical. It produces working code, but it doesn't optimise. https://harshanu.space/en/tech/ccc-vs-gcc/
@wilfredh The "can't compile hello world" bug report had nothing to do with the source code -- the compiler expected include files in the particular location of the systems it was built on, and couldn't find them when built on a system that located them differently. (Read the bug report and you'll see perfectly intelligible messages saying "stddef.h not found", etc. It did compile postgres to binaries that passed the test suite, and PG does require this header. A lot.)
@wilfredh A compiler without optimizations? So basically a macro assembler? Something that's really only different from a college student's homework assignment insofar as it has to has to support a bunch of historical quirks in the language's syntax?