← Blog

Zevic 0.4.0: self-hosting

In v0.4.0 the Zevic compiler is written in Zevic.

zevic1 (tools/zevic1/, about 13,000 lines of Zevic) is a complete port of the C implementation, with lexing, parsing, module resolution, type checking, LLVM IR generation and the clang driver. All 99 golden tests pass.

The bootstrap goes like this. The C zevic builds zevic1, zevic1 builds zevic2, and zevic2 builds zevic3. Every generation writes byte-identical LLVM IR (make bootstrap). That IR is committed as bootstrap/zevic.ll, so you can build the compiler from scratch with clang alone.

Other changes:

  • Union types A | B, x is T and type patterns in match (proposal 0007)
  • The standard library is now a real package called Zevic
  • Non-ASCII user names and folders work on Windows
  • Releases now ship a Debian package, a macOS .pkg, installers and checksums