Hello, cell
A Quilt cell is a named, addressable value. The smallest possible sheet has one cell.
id: hello
title: "Hello, world"
version: 0.1.0
cells:
- id: greeting
kind: value
value: "Hello, world!"
The cell, live
Reactive
A formula cell is a function of other cells. When an input changes, the formula recomputes. The whole thing is reactive.
- id: price kind: value value: 100 - id: tax_rate kind: value value: 0.08 - id: total kind: formula expr: "price * (1 + tax_rate)"
price or tax_rate, and total automatically updates. You don't write the propagation — the engine handles it.
The cells, live
Listeners fire on change
A listener watches a cell. When the value changes, the listener fires. That's where the side effects live — notifications, logs, writes, anything.
- id: temperature
kind: value
value: 22
- id: alert
kind: listener
watch: temperature
condition: "temperature > 30"
action: 'console.log("⚠️ Hot!")'
Set temperature to 35
Sensors read the world
A sensor cell reads from the physical world. A temperature sensor, a clock, a websocket. The cell holds the latest value.
- id: sensor.temp kind: sensor source: dht22 default: 22 - id: sensor.humid kind: sensor source: dht22 default: 50 - id: heat_index kind: formula expr: "sensor.temp + (sensor.humid - 50) * 0.05"
Live sensor readings
Routers dispatch by caller
A router cell returns different values for different callers. The same cell id, different outputs based on context.
- id: data.public
kind: router
routes:
- when: "caller.role === 'admin'"
expr: "all_data"
- when: "caller.role === 'user'"
expr: "filtered_data"
- when: "caller.role === 'guest'"
expr: "public_data"
data.public, they see everything. When a guest calls, they see only the public bits. The cell is the policy.
Call as different roles
Time travel
With quilt-time, every cell has a history. You can rewind, replay, fork, merge.
const q = new QuiltTime();
q.set('counter', 0);
q.set('counter', 1);
q.set('counter', 2);
q.at('counter', 1); // → 0
q.fork('experiment'); // snapshot
q.rewind('main'); // back to 2
The timeline
The mesh
With quilt-mesh, cells sync peer-to-peer. No server, no internet. Two devices, two engines, gossip.
let alice = QuiltMesh::new("alice");
let bob = QuiltMesh::new("bob");
alice.set("counter", 1);
alice.gossip_with(&mut bob);
// bob.counter == 1