Backends
cmotion has multiple backends so the same program runs on a CPU server, in a browser, on a GPU, or embedded in a host application. The language semantics are defined by the reference interpreter; every backend must agree with it.
WASM component codegen
Section titled “WASM component codegen”Compiles a cmotion program to a WASM component (Component Model). The component is the portable artifact — any host with a Component Model runtime (wasmtime, jco, browser) can load and run it.
Status: not started. See Roadmap stage 5.
CanvasKit (offline)
Section titled “CanvasKit (offline)”Deterministic offline render. CanvasKit (Skia compiled to WASM) draws each frame to a buffer; output is bit-identical across machines. This is the export path — .mp4/.png sequences for final delivery.
Status: not started. See Roadmap stage 6.
WGSL (realtime)
Section titled “WGSL (realtime)”GPU codegen to WGSL for realtime preview. Runs through wgpu so the same shader code targets Vulkan, Metal, DX12, and WebGPU. This is the editor/preview path — interactive scrubbing, parameter tweaking, live reload.
Status: not started. See Roadmap stage 7.
Conformance
Section titled “Conformance”Backends are tested against the reference interpreter:
| Layer | How tested |
|---|---|
| Values | wasmtime, headless, every commit |
| Offline render | CanvasKit + golden PNG diffs, every commit |
| GPU render | wgpu headless adapter + golden diffs, nightly |