Jeffrey M. Barber

Tombstone

vector-register

Dec 2014 โ€“ Mar 2015 ยท age 32โ€“33

What it was

A 2D vector math library for Java that refuses to allocate. Clean vector classes put every vector on the heap and churn the garbage collector in hot loops; hand-inlined arithmetic is fast and unreadable. vector-register split the difference: a VectorRegisterN object holds N vectors as plain double fields, allocated once, and every operation between any of them is a generated method with the indices baked into its name, like sub_0_from_1 or transform_1_by_0_2. A generator emitted fifteen such classes, each extending the last so it only added what its newest vector needed, along with a full JUnit suite whose expected values were computed separately at generation time. Line intersection, point-in-triangle and polygon tests were built on top, all without a temporary object. It was written in ten days, then rolled into the 2D editor it was made for.

Wins, for the age

What it taught

Genealogy

Ancestors: Vec4U: vector algebra compiled into specialized code for speed. Descendants: Adama Core: code and tests generated from one description, at language scale.

Epitaph

Here lies vector-register: fifteen registers, eight hundred methods, no allocations. It found its own first bug with tests it wrote itself, then went to live inside the tool it was made for.