Write
Every WebGPU resource is a form, checked against a WebGPU schema: buffers, textures, pipelines, passes, compute. Or skip all of that with the seven-line sugar above. SJON reference
PNGine
Declarative WebGPU in S-expressions that match the spec 1:1. Compile them to a few hundred bytes of bytecode, and play anywhere WebGPU runs.
A complete animated program, in SJON, the S-expression format PNGine reads:
(pass-graph
(pass :name main :code """
@fragment fn fs(@builtin(position) pos: vec4f) -> @location(0) vec4f {
let uv = pos.xy / vec2f(pngine.width, pngine.height);
return vec4f(uv, sin(pngine.time) * .5 + .5, 1);
}
"""))
pngine art.sjon # → art.png: image, bytecode and runtime in one file
Write
Every WebGPU resource is a form, checked against a WebGPU schema: buffers, textures, pipelines, passes, compute. Or skip all of that with the seven-line sugar above. SJON reference
Compile
One CLI: validate, compile, render, inspect, diff. A triangle is
631 bytes of bytecode; tucked into a PNG with its runtime, 4.6 KB.
CLI reference
Run
A functional browser API from 3 KB to 17 KB gzipped, or a standalone HTML file of around 1 KB with no dependency at all. JavaScript API
Inspect
Replay any compiled program against a mock GPU that records calls instead of drawing: call traces, per-frame analysis, black-canvas diagnosis, no browser needed. Inspect a payload