A program is an Interaction tree over Refs. Refs name locations in the world; Interactions describe what to do with them - read, write, compute, branch, iterate, compose. The tree runs against a Context that binds each Ref to a Fabric (kv, filesystem, http, browser, ...) and executes there.
# --- state ------------------------------------
Counter(Shape):
val: v.IntRef # ← kv storage
# --- ui ---------------------------------------
Dashboard(ui.Page):
count: ui.TextRef # ← refs as widgets
# --- app --------------------------------------
app = Parallel( # ← two flows in parallel
ForeverDo( # ├─ loop forever
Counter.val.inc() # │ ├─ add 1 to state
>> Delay(1.0) # │ └─ delay 1 second
),
ReactForever( # └─ react to changes
Counter.val.on_change(), # ├─ which ref
Dashboard.count.set(Counter.val), # └─ update ui state
),
)
# --- context (fabrics) ---
# Counter.val → kv storage (val = 42, persisted)
# Dashboard.count → browser tab (nu://dashboard renders 42)
- 00-abstract/ - high-level intro: motivation, two citizens, context.
- 01-foundations/ - core distinctions: atom vs composition, mutation, cardinality, kinds.
- 02-atoms/ - the kinds made concrete: Ref, Query, Command, Action, Flow, Span, Form.
- 03-fabric/ - the Fabric layer: address spaces, Context, resolution protocol.
- 04-domains/ - optional addons on top of the core. Each is a self-contained DSL + Ref blueprints.
- 05-meta/ - operations on trees themselves: transformations, equivalence.