A browser with Wasm GC and tail call support is required for this demo. We recommend using either Mozilla Firefox or Google Chrome.
Live-coding two pages with Hoot's REPL
Two RealTalk pages, each with its own code printed (well, typed) below. Drag the cards onto the table to activate them. Edit either textarea and hit Run to swap in new code: the engine retracts whatever the old code had Claimed and runs the new code in its place.
Eval'd code runs in (realtalk)'s scope —
Claim, Wish, When,
get-page, set-background! are all in reach
without imports. this inside the body refers to the
page's own id.
Output:
Things to try
With both cards on the table, try replacing page 1's body with:
Or have page 1 claim more than one fact:
Or replace page 2's rule to be selective:
Or react to page 1's second claim:
Drag a card off the table and watch the engine retract its claims:
rules that depended on them stop firing, and on the next fixpoint
the visuals reset because recalculate-pages wipes the
DOM and re-derives it from whatever facts remain.
Direct mutations like (set-background! (get-page this)
"pink") inside a page body run once and then get wiped by
the next reset — that's by design. Always write Claims for
facts you want to persist, and let rules do the drawing.