Tombstone
zmlc
Nov 2005 โ May 2006 ยท age 23โ24
What it was
"Zen's model language compiler." You wrote a schema that looked like a stripped-down C++ header, with classes, fields, pointers, arrays sized by another field, and note() annotations, and zmlc generated the rest for both C++ and C#: the classes, their accessors, single-owner ownership rules, deep equality, an XML serializer that kept shared references intact, and a flat binary format you loaded with one cast and a pass that turned file offsets back into pointers. The C# side carried each note into a property grid, giving every object a documented editor. The example that mattered was a scene format for Jeff's Cauldron game engine, so an editor in one language and an engine in the other could agree on one data model. Almost all of it was built in two days in May 2006, then licensed, documented and packaged.
Wins, for the age
- At twenty-four, generated zero-copy loading by pointer fix-up from a schema, eight years before Cap'n Proto (2013) made that popular. This ape with a keyboard did it for level files on a 32-bit desktop.
- One schema, two languages, one wire format with sharing preserved, concurrent with Apache Thrift (2007).
- Serialization treated as a problem about references, not fields, and handled correctly in three formats.
- A BSD license, a readme, per-language snippets and examples from tiny to real: the first project in the graveyard packaged as if a stranger would download it.
What it taught
- Define the shape once and generate everything that has to agree with it. Later projects depend on this habit entirely.
- A generator is a compiler and should be structured like one: grammar, intermediate form, per-target emitters.
- Generate a hand-editable file once and never overwrite it. That answers the question every code generator eventually faces.
- One round-trip test would have caught the
Vector4that loaded its fourth component as its third. It shipped without one.
Genealogy
Ancestors: none on record. This is where the schema compilers begin. Descendants: Cauldron v2 ZMLC: the same compiler grown up inside the engine. Inferno: schema to C++ or C# with ownership and flat binary. Jovian Suite: a schema-generated model behind a web designer. Kitchen: the engine that ran on its generated data classes. Kitchen ZMLC2: the header-shaped schema, now emitting reflection and script field maps.
Epitaph
Here lies zmlc, a header file that compiled itself into two languages, three formats and an editor. It wrote pointers to disk, read them back with a cast, and said the shape once.