Algorithmic Intelligence
Cellular automata, fractals, and the WASM victory lap.
I started this for fun. I wanted to scrub a slider on Conway’s Game of Life and have it stay at 60fps with a million live cells. JavaScript wasn’t getting me there alone. Rust compiled to WASM did, almost embarrassingly easily.
The unexpectedly hard part was not the simulation but the boundary between WASM and JS, passing data without copying, scheduling work without blocking the main thread, finding a sane way to feed coordinates into WebGL without serializing through JSON. Once those were dialed in, performance stopped being a constraint and the project became a creative tool. I started using it to explore systems I’d only ever read about.
WebGL turned out to be the right choice over canvas for almost everything that involved more than a few thousand visible elements. The mental model is rougher, buffers, attributes, draw calls, but the throughput is in a different universe. Once you get one good instanced-rendering pipeline working, you can stop worrying about how many particles you’re drawing.
The thing I’m most proud of is that the controls feel right. You can drag a parameter and see the system react in real time, and that immediacy is the whole reason simulators like this exist. A lot of educational tools fail because the loop is too slow, you change something, you wait, you forget what you changed. The latency between intent and result is the actual product.
Mostly what I learned is that for any visualization-heavy project, the right answer is to push the hot loop into WASM and keep React for the chrome. The two play nicely together once you stop fighting them. React is great at managing UI; it has no business inside a 60fps inner loop.