Skip to main content

The Origin of Stof: From CAD Software to a Data Runtime

CJ Cummings
Creator and maintainer of Stof, co-founder & CEO of Limitr

Stof wasn't designed as a product. It came out of about a decade of building parametric and geometry formats for CAD and graphics systems at Siemens, Lockheed Martin, Configura, and Anark. On the surface, that work has nothing to do with web APIs or config files. Underneath, it has everything to do with them.

What CAD teaches you about data​

A parametric CAD model isn't a static shape. It's a set of constraints and relationships (this face stays perpendicular to that one, this length depends on that parameter) that the software recomputes constantly as a designer drags things around. The geometry comes out of the logic. A model that couldn't recompute its own constraints wouldn't be a CAD model. It would be a picture of one.

Build systems like that long enough, and you stop thinking of data and the logic that works on it as separate things. They never were, in the systems I worked on. The usual split, a data file here and an app that interprets it over there, started to look less like a law of nature and more like a habit that came from which tools got popular for which jobs.

The idea that came out of that work: store everything as a flat graph of objects and data, connected by references instead of nested copies. An object isn't a deep tree you copy to move. It's an entry in a list, and its relationships are pointers that are cheap to change. Once geometry, constraints, and the functions that maintain them are all data on the same graph, moving or transforming any part of the document isn't special or expensive. It's updating a pointer.

Trying to send WebAssembly over the wire​

Stof started as a solo experiment. I was trying to send WebAssembly over the wire, and kept hitting the same wall. Wasm binaries are big, they come with tooling and dependencies, and whatever carried them had no good way to also carry the data that made them useful when they arrived. Every option meant picking a side: either inert data that the receiver already had to understand, or executable code with nowhere natural to keep the structured data it worked on.

The flat graph from the CAD work made a different answer feel obvious. If a function is just another kind of data on an object, no different from a field except that it can be called, then one document can carry both without bolting one onto the other. Fields, functions, and later richer data like images and PDFs all became the same kind of thing on the graph. Let functions change the graph they're attached to, sandbox what else they can reach, and the rest of Stof follows. It's a superset of JSON because JSON was already the shape of plain data, and adding logic didn't require breaking that.

From experiment to production​

Stof now runs in production as the engine underneath Limitr. Every plan, credit limit, and rule there is a live Stof document, not a config file that Limitr's code has to interpret separately. It's the same idea as the CAD work, aimed at pricing instead of geometry: the rule and the data it governs are the same object, so they can't drift apart the way a schema and the data it checks so often do.

None of this started as a thesis about data and logic belonging together. It came from a decade of building systems where that was already true, and noticing that most software, for understandable reasons, ended up somewhere else.

The shortest way to say what came out of it: JSON that runs. For the longer version, start with What Is a Data Runtime?.