Tombstone
ZSL
Jan 2002 โ Feb 2003 ยท age 20โ21
What it was
The "Zenerd Standard Library", version 0.340: three thousand lines of C++ a game programmer builds before the game. A vector, matrix and quaternion core. Geometry for spheres, planes, rays, boxes and squares, with swept tests that solve a quadratic in time to say when a moving sphere enters and leaves a plane or another moving sphere. A compacting heap reached through handles. Octrees and quadtrees whose objects climb only as far as they must when they move. An integer radix sort, and a float one that remaps IEEE bits so floats sort as unsigned integers. Every declaration carried a one-line Doxygen brief, and a generated manual shipped with it. Its last build reported "up-to-date" and changed nothing.
Wins, for the age
- At twenty, Jeff split the vector type into a class that computes through a borrowed pointer and a subclass that owns its storage, so the same math runs directly on a vertex buffer with no copy. NumPy's array views had found that line years before; this primate drew it again for linear algebra, and the standard library eventually drew it too.
- Worked out an interval-intersection function in OCaml first, then kept the OCaml above the C++ as its specification. A mammal thinking in the language with pattern matching.
- Derived swept-sphere collision, quaternion rotation and plane construction from first principles, with the working in the comments.
- Wrote a brief on every declaration of a three-thousand-line library. The earliest evidence on record of writing for a reader.
What it taught
- Build the foundation first: before the engine, the library; before the library, the math.
- Find the representation in which the problem is short: interval overlap as a pattern match, collision as a quadratic, floats as ordered integers.
- Documentation is not verification. Two distance functions returned a dot product instead of a distance, a rectangle split mis-sized its quadrants, and the manual described each as working. There were no tests.
- Shipping without tests costs little in a hobby library and more later. This is where that habit first shows.
Genealogy
Ancestors: Z Character Exhibitor: the editor that first linked this library in place of older ones. Descendants: Cauldron v1: the engine the library was waiting for, with SSE math. Rage: the engine experiments built on hand-rolled math. Vec4U: vector algebra, turned into a typed language compiling to SSE.
Epitaph
Here lies ZSL, which could sweep a sphere through a plane and sort a million floats in four passes, and whose OCaml is still there above the C++, waiting to be read.