A kilobyte is not much. It’s a quarter of this article. Someone has used it to draw a fluid vortex, twice, on hardware from 1989.
The project, posted to Show HN this week, visualises the Burgers vortex — an exact solution of the Navier–Stokes equations published by J. M. Burgers in 1948 — as two sub-1,024-byte MS-DOS executables, with JavaScript reference versions alongside. The author started after seeing the visualisations that followed a recent Navier–Stokes announcement, and chose the Burgers vortex because it has the right anatomy: fluid drawn inward, stretched along an axis, thrown out of both ends, spinning fastest at the core.
Two approaches
PALETTE.COM is the elegant one. Streamlines are drawn once, back to front, and then not one pixel is written again. The flow you see is the palette turning — the classic Mode 13h trick where you animate by rewriting the colour lookup table rather than the framebuffer. Motion for free, forever, at zero per-frame cost.
PARTICLE.COM does it honestly: 200 particles animated in real time, with camera movement, holding 35fps on an emulated 386.
Both run in Mode 13h (320×200, 256 colours) and use fixed-point arithmetic, lookup tables and approximations in place of anything expensive — no square roots, no exponentials.
The size-optimisation log
The particle version started at 2,725 bytes and reached 1,022 over four passes. The published steps are worth reading as a compact course in constraint:
- Particles stored in registers rather than memory variables
- One Bresenham line routine replacing several specialised variants
- Formulas replacing lookup tables where the formula is smaller — fade computed as (32 − age)² instead of stored
- Merged initialisation routines and deleted unreachable guard clauses
That last one is the tell of real size coding. In ordinary programming, a guard clause that can’t fire is harmless defensive hygiene. At this scale it’s bytes you don’t have, and you must reason about the entire state space of your program to know it’s safe to remove.
Why this still matters
Size coding is the demoscene’s oldest discipline and it remains the best teacher of a specific skill: knowing exactly what your code costs. Modern creative coding runs on layers — a framework on a runtime on a browser on an OS — where it’s possible to ship a beautiful sketch without any idea what the machine is doing. Writing 1,022 bytes of assembly makes that impossible.
There’s also an aesthetic argument. Palette cycling produces a specific quality of motion — continuous, dreamlike, slightly wrong — that came from a hardware limitation and has never really been replaced. Work like this keeps those techniques legible rather than lost.
The JavaScript versions are the on-ramp: same maths, in a browser, with parameters you can push past anything a 386 could do. The NASM sources run in DOSBox.