April 11, 2026
Worst language, best chaos
Building a Z-Machine in the worst possible language – Whitebeard's Realm
Dev builds a retro text game engine in Elm — fans buzz
TLDR: A developer built a working Z‑Machine (the old engine behind Infocom text adventures) in Elm, a language that avoids changing data, and it runs classic games. Comments celebrate the feat, pitch Clojure, and swap nostalgia links like IFDB, arguing whether it’s genius engineering or fun overkill.
An internet tinkerer just rebuilt the classic Z‑Machine — the engine behind 1980s text adventures from Infocom like Zork — in Elm, a language famous for not letting you change data in place. Sounds impossible? Thanks to clever, shareable arrays (think smart copy‑on‑write), it actually runs, passes compliance tests, and can play .z3 games in the browser. Retro feels, modern rules.
The vibe in the comments is instant nostalgia-meets-nerd victory lap. One early fan cheers, “If it works in Elm, Clojure can do it too,” and points newcomers to the thriving interactive fiction scene: try the database at IFDB and seek out cult favorite “Vespers.” The mood splits along familiar lines: functional‑programming fans see this as proof that “pure” languages can handle gritty, old‑school machines, while pragmatists are already muttering, “Neat… but why not pick an easier tool?” The jokes write themselves: “Worst Language% speedrun,” “No infinite loops? No problem,” and “Hold my stack.”
Under the drama, the takeaway is simple: this is a stylish flex that brings vintage games to new places, no hacks, no tears, just smart design. Whether you call it galaxy‑brain engineering or glorious overkill, the result has everyone rummaging for their next text adventure and a comfy chair.
Key Points
- •A working Z-machine emulator was implemented in Elm, a pure functional language with immutable data structures.
- •Elm’s persistent Arrays (RRB trie variant) provide sufficient performance for VM memory updates despite immutability.
- •The emulator runs Z-code version 3 (.z3) Infocom games and passes the Czech compliance test.
- •Development required interpreting the Z-machine specification, notably handling its text encoding.
- •The library exposes a step-based API (load and run steps) suitable for environments like Elm without infinite loops, enabling browser-based interactive fiction players.