This blogpost focuses on our second Spring Lisp Game Jam 2023 entry, wasm4-wireworld, an implementation of Wireworld on top of Hoot’s lower-level assembly tools which are a part of our Guile → WASM project to bring Spritely Goblins-powered distributed applications to the common web browser.
For our entry, we targeted WASM-4, a “fantasy console” which uses low-level WebAssembly constructs.
In fact, if you see the animated “wireworld” splash screen at the top of this article, that’s running wasm-wireworld itself… you can even run it live in your browser!
The real point of this blogpost isn’t Wireworld itself, but how Hoot enabled making this Wireworld demo. So we’re going to walk into how Hoot turned out to be an incredible toolkit to build this game jam entry, but first let’s talk about Wireworld to give some more context!
Wireworld is a powerful cellular automata, categorically similar to Conway’s Game of Life. Unlike Life, Wireworld’s paths are fixed: “electrons” flow upon copper wires. The rules of Wireworld are very simple:
- Blank tiles remain blank
- Electron heads always become electron tails
- Electron tails always become copper
- Copper stays copper, unless there are one or two electron heads in any cardinal direction, in which case it becomes an electron head
That’s it! Despite that simplicity, this leads to powerful emergent behavior. Electron head and tail pairs appear to “flow” fluidly upon copper wires and can branch easily. But we can also make “generators” and diodes that only permit electrons to flow in one direction and not another:
These rules result in behavior which permits visually stunning examples, many of which even look like computational circuitry.
Read the rest and play with our web-embedded WASM on the blog: