Reactive bindings

bind declares a name that auto-recomputes when any of its dependencies change.

Summary

bind total = price * qty tracks which var bindings are read during the first evaluation. When any of them are reassigned, the bound expression re-runs and total updates. Cascading works: a binding that depends on another binding updates correctly when the chain changes. Reactivity runs on the interpreter, VM, and JIT. Transpiler targets (--emit js/c/wasm) lower bind to a plain let since static targets cannot hook variable mutation at runtime.

Canonical

bind declares a name whose value tracks an expression: when any referenced var changes, the bound name re-evaluates.

var price = 100
var qty   = 2
bind total = price * qty
println(total)                  -- 200
price = 150
println(total)                  -- 300

XS used to ship a separate signal() / derived() / subscribe() library for the same job; it was cut in 1.2 because bind covers the same use cases with less surface and works on every backend.