Skip to content

cmotion

cmotion is a small, statically-typed programming language for video, motion graphics, and animation — an open-source project (MIT licensed) on GitHub. The same source program renders identically as a deterministic offline frame sequence and as a realtime GPU preview.

It is infrastructure, not a product — hosts embed it.

Edit the source below and click Render to see it run. The code is parsed, type-checked, and evaluated by cmotion-render.wasm — the same interpreter that powers cmo on the CLI.

Edit above, click Render to apply. Open in /editor →

A single program contains:

  • Units across domains (1920px, 6s, 280deg, 8.6deg, 0.25) — the type system enforces that a duration is a duration and a length is a length.
  • Perceptual color (oklch(0.78, 0.20, hue)) — animating only the hue gives a smooth color wheel with no muddy midpoints, because oklch / oklab / srgb are first-class color literals in the language.
  • 3D primitives (extrude(text.glyph("C"), depth: 16px)) — mesh3d is part of the stdlib; 3D scenes project back to a 2D Layer via render3d(...) so they compose alongside 2D layers.
  • Composition (compose [bg, render3d(...)]) — layered, typed, declarative.
  • Animation as valuesanimate { ... } with { repeat: forever } for keyframes and wave(amplitude:, period:) for continuous motion. Multiple independent animations drive different properties of the same mesh (x and y rotation, scale, hue) and loop on their own periods.

This is the language and toolchain reference. It is built in public, in stages — see the Roadmap. The Grammar is locked at v0.2, and the reference interpreter that runs on top of it renders the scene above.

cmotion is live and open source. The grammar is locked at v0.2, and the reference interpreter (cmo on the CLI, the same core as cmotion-render.wasm) parses, type-checks, evaluates, and renders 3D scenes — in the CLI, the in-browser editor, and the hosted render API. Still on the roadmap: the full type system and the canonical CanvasKit and WGSL backends. See the Roadmap.