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.
More from coding & agent
- Cloudflare cf CLI turns any webpage into Markdown in one command, keeping raw HTML out of agent context — dinasaur_404 · 2026-09-30
- One operator commanding seven AI agents: swarming orchestration demo called 'disturbing' — sethlazar · 2026-09-30
- DHH's AI coding workflow sparks debate: speed vs. understanding — georgemillo · 2026-09-30
- Delegance Turns a 1000-Page Insurance Binder into a Weaviate Knowledge Base in ~2 Minutes — CShorten30 · 2026-09-30
- Think gets 50+ durability and reliability improvements ahead of release — threepointone · 2026-09-30
- AI game dev's missing piece solved: automated rigging and animation — anselm · 2026-09-30