I Rebuilt ZX Spectrum Basic in Rust with AI A software engineer rebuilt the 1982 ZX Spectrum BASIC interpreter from scratch in Rust, creating a high-level emulation that runs natively in browsers via WebAssembly without emulating the original Z80 CPU. The project, built in hours using AI tooling guided by a single developer, demonstrates that modern AI workflows can decode undocumented legacy assembly and re-implement 40-year-old semantics across a significant language gap. A modern reimplementation of the 1982 ZX Spectrum BASIC interpreter, written in Rust, running natively in your browser via WebAssembly β€” built end-to-end as an AI software-engineering experiment. 🟒 Live: https://experiments.frontierslab.ai/zxspectrum https://experiments.frontierslab.ai/zxspectrum zxbasic-rust is a from-scratch reimplementation of the BASIC runtime that shipped on every Sinclair ZX Spectrum 48 K β€” the interpreter, the line editor, the calculator, the screen, the keyboard handler, the beeper, the lower-screen "0 OK" report, even the flashing inverse- K cursor. There is no Z80 CPU emulation, no instruction decoder, no bus, no cycle-stepped ULA, and none of the original ROM bytes are ever executed β€” in the taxonomy of emulator design this is high-level emulation : every behaviour the 1982 hardware exposed is re-derived in idiomatic Rust from reading the original Z80 source as a specification, and then compiled to native macOS / Windows / Linux binaries and a tiny WebAssembly module that boots a Spectrum-perfect screen inside any modern browser. You can paste a program written for a real Spectrum and it just runs. The Β© glyph from the original character ROM. The exact bordcr colour pair the lower screen shifts into after BORDER 2 . The K-mode cursor that pulses through the FLASH attribute bit at the same cadence as the real ULA. The 0 OK, 0:1 status line that appears the instant a program completes. It is also, deliberately, a controlled experiment in what current AI tooling can do . For decades, "port the BASIC ROM of a 1982 home computer to a modern stack" has been a textbook example of a project that demands a small team of specialists and a long calendar. You need someone who reads Z80, someone who understands the calculator's bytecode dispatch, someone who can reverse the screen attribute model, someone who can land it on multiple targets, and time β€” months of it β€” to align all of that with what real software actually does. This repository was built in a handful of hours , by a single experienced AI builder driving a bespoke workflow designed specifically to reconstruct architectures out of assembly-era source β€” no human ROM expert in the room, no prior port to crib from. The 16 KB of commented Z80 served the same role a real hardware specification would: an authoritative reference for what the system does. The workflow handled the how β€” reading the source, re-deriving semantics in Rust, picking the architecture, writing the tests, debugging failures from screenshots, refactoring when the design stopped fitting, and ultimately producing a runtime that boots into a screen indistinguishable from a real Spectrum's. That is the demonstration. The interesting thing isn't that "the AI wrote some code." The interesting thing is the kind of code: Decoding undocumented legacy assembly. Following 16 KB of hand-written Z80 across thirteen files of jumps, system variables, and self-referencing data tables. Recognising the calculator's tokenised bytecode is not Z80 instructions. Inferring that bordcr is a packed attribute byte and that set de is the editor's cursor-positioning routine. Reading the ROM the way a domain expert would β€” without one in the room. Re-implementing semantics across a 40-year language gap. Translating side-effecty Z80 with shared system variables into an idiomatic Rust state machine with explicit ownership. Choosing where to mirror Spectrum quirks pixel-for-pixel the Β© at character 0x7F, the 0 OK, 0:1 report format, the FLASH-attribute cursor pulse and where modern abstractions are obviously better the audio queue, the frame-driven scheduler that doesn't freeze the browser tab during an infinite loop . Targeting platforms the original couldn't reach. The same Rust core compiles to a native desktop binary and to WebAssembly. The browser frontend is 16 KB of unoptimised .wasm , draws straight to a