# I vibe-coded a C compiler that can build SQLite

> Source: <https://blog.fsck.com/2026/08/21/i-vibe-coded-a-c-compiler/>
> Published: 2026-08-22 18:04:30+00:00

# I vibe-coded a C compiler that can build SQLite

A while back, Claude Opus [built a pretty ambitious compiler.](https://github.com/anthropics/claudes-c-compiler/issues/1)

I didn't set out to do anything nearly as ambitious as Anthropic's. They were targeting multiple CPU architectures and they wanted to be able to compile a bootable Linux kernel.

(I'd actually forgotten about that project until I started posting some screenshots of the work below to social media and someone reminded me.)

Last night, as I was getting ready for bed I was reaching for some project to `/loop`

support and tool use in Evener, our ~new agentic harness. I popped open the mobile UI on my phone and typed "Your job is to implement a standards-compliant ARM64 C compiler for macOS in Swift."

Evener asked me a couple of questions.

I clarified my intent a little bit: "I'm great with radical task decomposition. You should use recursive subagents to manage context and complexity.Should structure the project in whatever sane way you want. You should work fully autonomously And do not need to ask me questions."

And then I set a goal: "Implement a standards-compliant C compiler in modern Swift. It should be able to build SQLIte and have SQLite pass all tests. You may decompose the project in any way you see fit. You should use subagents, including recursive subagents, to execute effectively."

I don't know what I thought was going to happen.

I watched long enough to make sure that it was going to start working.

At about four in the morning I rolled over and looked at my phone and it was deep into debugging a malloc issue.

I woke up at a little bit before seven and it was implementing variadic functions.

Today I spent most of my day in meetings and so I didn't get a lot of time to watch it, but I would occasionally pull up a session and see it making little bits of progress. Occasionally it would dump out some assembler and then dump out `clang`

's version of the assembler to hunt for differences.

I saw it trying to build the 274k `sqlite.c`

amalgamation and segfaulting.

I saw it writing little test scripts.

I saw it get to the point of trying to do an `INSERT`

and exploding.

When I came up for air at about 8 30 p.m. I popped open Evener around my phone, and was incredibly disappointed. My `/goal`

loop had just...stopped.

It's not supposed to do that. But that's exactly the failure that I was testing for.

I started reading the recent parts of the log, to figure out *which* obvious problem had caused the failure.

I was *not* expecting to see this:

It stopped because it had compiled SQLite and was able to do an `INSERT`

and a `SELECT`

.

It did exactly what I asked.

It took Evener + GLM 5.2 about 21 hours to build a C compiler capable of compiling SQLite and passing a basic smoke test.

This is the checkpoint:

[https://github.com/obra/toy-c-compiler/commit/456ddfa8912b5ba47b968773ecddcdca741f0df2](https://github.com/obra/toy-c-compiler/commit/456ddfa8912b5ba47b968773ecddcdca741f0df2)

(I was initially worried that it had cheated by doing the obvious web searches, but discovered late in the day that I had accidentally broken the harness's web fetch tool. And so it wasn't able to cheat that way.)

Checking now, it looks like it didn't even *try*, which makes me happy.

There are a ton of missing features. It is not yet standards compliant, but I didn't properly set the goal to force that.

I've just kicked off another `/goal`

to get it to run through compliance suites and fill in the missing features. I'll probably let it run for another day or two just to see what happens.
