Schemd

A zero-dependency compiler that turns a small text language into accessible, deterministic SVG for circuits, logic, quantum gates, and UML. It runs on the server or at build time, so pages ship the drawing, not a drawing library.

Schemd, screenshot 1 Schemd, screenshot 2 Schemd, screenshot 3 Schemd, screenshot 4

The problem

Diagrams in technical writing are usually exported images: they drift out of date, are hard to review in a pull request, and say nothing to a screen reader. Diagram tools that draw in the browser need a DOM layout pass and ship a heavy runtime to every reader.

What I owned

All of it: the language, the parser, placement and the wire router, the netlist and accessibility layers, the test and release gates, and the website with its docs, playground and simulation labs.

Constraints

No runtime dependencies, and no DOM, canvas, browser layout, external fonts, or getBBox(), so it runs anywhere JavaScript does. The same source must always give byte-identical SVG. The compiler's size has a hard budget checked in CI; untrusted input can be bounded with limits and a timeout, and every diagnostic says how to fix the problem.

The tradeoff

Never touching a browser made the output deterministic and server-side, but it meant measuring text against Arial's metrics myself, and labels are placed without regard to their neighbours, so a crowded sheet can overlap. Routing is heuristic and bounded rather than optimal: a document too crowded to separate is rejected, naming the wire that couldn't be placed.

What shipped

@schemd/core 1.3.1 on npm under the MIT licence: 22 releases since July 2026. Every release must pass 100% statement, branch, function, and line coverage, mutation testing, visual tests, a 20,000-case contract fuzzer, and the size budget before it is published. The schematics in this site's articles are written in and rendered by it.

Notes

A compiled diagram is also a model. Alongside the SVG, the compiler can give you a netlist, run seven structural design rules over it, describe the connectivity in prose for screen readers, and map every vector back to the line that declared it.

Every component's options are published as data through @schemd/core/schema, proved against the parser, so editors and docs can list what a part accepts without copying a table.

The website has versioned documentation for each release line, a playground that compiles as you type, an inspector, and interactive simulation labs that bring compiled circuits and quantum examples to life.