Building Lumen in Rust: adding data-carrying enums and match without touching the backend

Abhishekcur · x · 2026-09-30

The author shares a detailed engineering log of Lumen, a small statically typed language built in Rust with a typed IR and stack-based bytecode VM. Next features: data-carrying enums and match arms, plus lifting the array-of-structs restriction (a type-system-only limit, since structs already store as arrays and tuples get interned by index). Design choices: no generics yet (hand-write maybeint until the third one), flat patterns only, enums lower to the same tag-plus-fields shape as structs, match becomes if/else on the tag. He predicts no backend changes and writes the prediction down to verify it. Known issue ahead: reference counting + recursive data means cycles will leak, deliberately unfixed. End goal: a Lumen lexer written in Lumen.

Original post →

More from coding & agent

coding & agent channel →