Show HN: Emergence: a fun little app to play with chaos
modlit.ioI built this to demo some cool simple concepts in emergent behaviour and to showcase my services for science/engineering app building.
There are 21 simulations: cellular automata, flocking, a traffic model, an Ising magnet, lattice Boltzmann fluid flow, fractals, a few chaotic systems. It is plain TypeScript with no framework and no runtime dependencies, and everything runs client-side.
A few things I'd point at:
- Each simulation is a plug-in. The model is a set of pure functions; the app only knows a small interface (step, draw, controls, stats, docs). - The explanations beside each one make claims, and where the model can check a claim there is a test that does. That caught my own documentation being wrong more than once. - The fluid solver does about twenty million cell updates a second on one core. Doubling the grid would cost eight times as much, so it is 300x120 with smoothed drawing.
Write-up: https://modlit.io/writing/emergence/
Happy to answer questions about any of the models or how it is put together.
So I fell in love with Physics when I read Chaos by James Gleick and I didn't actually know how to program at the time but much of the book was rooted in the concept that chaotic non-deterministic behaviour can emerge from a few simple rules. Probably the best known example is the butterfly effect but there are many others. 20+ years later I am able to vibe code this app to visually demonstrate this simplicity and chaos. Would love to get some feedback on the app. Please be as honest as possible. Or just some chats about Chaos.