Vibe Coding a Lox Compiler, Part 6: LLVM IR & Native Compilation
Written with AI This post — and all the code behind it — was built with Claude Code. Read Part 0 for the full story of how this AI-assisted project came together. Previously in this series, Part 1 introduced the project and the Lox language. Part 2 built the tokenizer using winnow, Part 3 wrote the recursive descent parser, Part 4 covered the tree-walk interpreter, and Part 5 added a bytecode virtual machine as a second execution backend. At this point, vibe-lox has two ways to run a Lox program: walk the AST directly, or compile to bytecode and run it in a stack VM. This post covers the most ambitious backend yet: compiling Lox all the way to native machine code via LLVM. ...