<Post

Super Mario Derivations

Nix’s lazy attribute sets can encode a game’s input history as a derivation graph: each button press becomes a derivation whose input is the previous frame’s savestate. The Nix store then acts as a content-addressed, branchable emulator history—branching from a hundred-press run costs only the new press, and assembling a recording just links the already-built frames.

The experiment is a precise demonstration of why Nix’s laziness and store model are more general than package catalogs. It also exposes practical limits: evaluation is linear in the input sequence, command-line argument size caps long runs, and substituter round trips can cost more than emulation.