RemoteCompose

A compact binary UI / canvas format for streaming interactive scenes — drawing, layout, expressions, animations, particles, paths, shaders, bitmaps — to remote players.

A RemoteCompose document is a single binary file (typically a few KB) that any compatible player can load and render identically. Players exist on macOS, iOS, Android, Compose Multiplatform Desktop, the browser, Node, and embedded devices. Every demo on this page is the same `.rc` binary playing in your browser through the TypeScript port of the runtime.

What it offers

Compact — A complete animated scene fits in 1–10 KB. The watch movement at the bottom is 24 KB; the pendulum is 2.5 KB.
Self-contained — One file carries layout, paint state, expressions, animations, paths, fonts, bitmaps, and shaders.
Expression engine — A stack-based RPN evaluator with ~40 operators (arithmetic, trig, logic, splines, springs, system variables) drives any value: positions, colours, text, paint parameters.
Layout — Compose-style intrinsic-size + measure / position passes, with modifiers (padding, background, border, offset, visibility, …).
Drawing — Canvas primitives, paths, gradients, text alignment, clip rects, transforms, blend modes.
Animation — Time variables (animation time, delta time, wall-clock components) drive expressions; particle systems are container ops with per-particle expressions.
Shaders — AGSL fragment shaders embed in the document and run on whatever GPU pipeline the player has (Skia / Metal / WebGL).
Touch & input — Touch position / velocity are first-class system variables; documents can be interactive without any host-side glue.

Examples

All ten render in this page right now, with no external requests. Each is the result of loading one `.rc` file (a few KB) into the in-browser player.

Drawing primitives

Rectangles, rounded rectangles, circles, arcs, paths, gradients and anchored text — the core canvas vocabulary in one document.

1.3 KB · canvas_primitives.rc

Pie chart

A chart built from sectors, anchored labels, and a centred title. All values are computed at paint time from the document's data, not baked at authoring.

3.8 KB · pie_chart.rc

Advanced operators

Stunning effects via shaders, particles, anchored text and other advanced operators — the runtime transpiles AGSL to whatever the backend speaks (Skia / WebGL / native).

2.7 KB · canvas_advanced.rc

Analog clock

Hour, minute, and second hands driven by the document's expression engine reading system time variables. No JavaScript on the page side — the document itself is doing the math every frame.

2.0 KB · fancy_clock2.rc

Linear regression

Live least-squares fit through a draggable scatter — the slope, intercept and residual error are all expression-evaluator outputs recomputed every frame as the points move.

3.3 KB · linear_regression.rc

Particle system

Hundreds of particles emitted from a source, each updated by an RPN expression every frame: position += velocity, velocity += gravity. Document fits in 4.5 KB.

4.4 KB · balls_animation_example.rc

Double pendulum

Coupled-ODE dynamics of a chaotic double pendulum, computed by the engine's expression evaluator. The trail is a path that appends a vertex per frame.

2.4 KB · double_pendulum_example.rc

3D rendering

Eight vertices, six faces, projected onto the canvas via matrix-expression operations the engine exposes natively. Back-face culling is a 2D cross-product check.

2.7 KB · cube3d.rc

Live expression tree

A visual tour of the RPN evaluator: an expression is rendered as a tree, with each node showing its current numeric value as the input variables animate. Self-documenting.

2.7 KB · rpn_eval.rc

Skeletonized watch movement

Six gears with verified 60 : 1 + 12 : 1 reduction trains, real interlocking tooth counts, balance wheel + pallet fork + escape wheel + hour / minute / second hands. All geometry is computed; all motion is the document's own expressions.

23.1 KB · watch_movement.rc

Available players

One binary format, many runtimes. All produce identical output on the same document.

C++ (rcX) Skia bridge, GLFW desktop viewer (macOS, Metal & CPU), SwiftUI iOS / iPadOS app with Metal-backed Skia, headless rc → PNG and rc → JSON tools.
Compose Multiplatform Kotlin Multiplatform engine + JVM Desktop host, sharing modules with the upstream Android implementation.
TypeScript Browser Canvas2D player (this page), Node-side rendering, static-deck-site generator, single-file standalone HTML builder, VS Code custom-editor extension.
Android (upstream) The reference implementation lives in AndroidX — Compose and View hosts, an offline player, Bitmap exporters. Documents authored anywhere render identically there.