I’ve just launched a web-based playground for MMIX, Donald Knuth’s RISC architecture from The Art of Computer Programming: https://bolt.bobjansen.net. The source is on GitHub. Almost all of the code by Claude, the idea and bugs or by me.
What is it?
The playground lets you write, assemble, and run MMIX assembly code directly in your browser. It’s powered by Emscripten (compiling Knuth’s original C/CWEB code to WebAssembly) and PyScript for the interface.
Why MMIX for Advent of Code?
This year, I’m planning to solve Advent of Code challenges by hand-coding solutions in MMIX assembly. It will be a nice change of pace from daily work, and while it won’t be the fastest I think I’m going to learn a lot with this approach.
Technical Details
The playground is built by compiling Knuth’s original MMIX tools to WebAssembly:
Compilation: Knuth’s MMIX simulator (mmix) and assembler (mmixal) are written in CWEB (literate programming combining C and TeX). I use ctangle to extract the C code, then compile it with Emscripten to produce WebAssembly modules. The build process uses change files (.ch files) to make necessary modifications for the web environment – this respects Knuth’s license which prohibits modifying the original source directly.
Frontend: The interface is built with PyScript, which runs Python in the browser via Pyodide. This handles the text editor, file management, and orchestrating calls to the MMIX WebAssembly modules. Users write assembly code, click “Assemble & Run”, and PyScript coordinates running mmixal to assemble the code into an object file, then mmix to execute it.
Source: All source code and build scripts are available in the repository. The /mmix/ directory also serves the complete MMIX toolchain (native binaries, WASM files, documentation PDFs) for anyone who wants to explore Knuth’s architecture in depth.