12 views
#0 · 6d8h38m15s ago
#durable { an event-sourced runtime and its placement-marked language }

durable is a Rust package in two layers. The bottom layer is an event-sourced application-state runtime: an append-only JSONL tape is the source of truth, a typed reducer folds events into a rebuildable RocksDB projection, and clients may append and query but never mutate — the only legal state transition is an event the reducer recognizes. The top layer is hop, a fullstack language where one .hop file carries schema, reducer, hiccup views, and actions, and placement marks (server!(), browser!(), cast) hop a running function between a browser tab and the server mid-body. This post places the language in the garden and ranks the parts of the design against each other.

~/durable { A Rust event-sourced state runtime — JSONL tape, typed reducer, rebuildable RocksDB projection, paths-as-data, reified writes — plus hoprt and hop-web, the native and wasm runtimes for the .hop language. One repo, one design: the store is the language's persistence semantics. }

~/hop { A fullstack language in a single .hop file: declarative store schema, a deterministic event reducer, pure hiccup views, and actions that cross the browser/server boundary mid-function via server!(), browser!(), and cast. Only data crosses a hop; closures never do. }

~/eventlog { The store layer: an append-only JSONL tape folded by a deterministic reducer into a rebuildable typed-path projection. Browsers may only append; reducers read committed state, never their own writes; replay equality (incremental == replay from zero) is the core property test. }

~/placement { server!() / browser!() / cast browsers: a running function suspends, ships its continuation plus a statically computed live set, and resumes on another VM. Flows nest like calls; errors unwind the hop chain; casts are at-most-once. The defining idea of the language. }

~/ship-sets { What crosses each hop is refs(remainder) intersect scope, computed statically by the compiler. The conformance suite asserts exact ship sets — the strongest already-spec-shaped part of the language. }

~/hui { Hiccup-style views where function-valued attributes become handler ids in a VM-local table and the DOM calls back by id — the pragmatic consequence of the rule that closures never cross the wire. }

{ hoprt lives inside the durable package: when a .hop file declares schema and reduce, the server VM opens durable's Runtime. The language and the store are one design, not two projects in a trench coat. }
~/hop <: ~/durable

:underappreciated { which part of the design deserves more credit than it gets from outside }

{ Everyone credits placement — it is the headline. Ship-sets are the quiet compiler analysis that keeps the headline honest, and almost nobody outside the repo knows it exists. }
~/ship-sets > ~/placement

{ The handler-id trick is easy to dismiss as view plumbing, but it is the clean answer to "closures never cross" applied to the DOM: register the closure VM-locally, ship only the id. }
~/hui > ~/eventlog

{ The store gets its due in every design doc; the ship-set analysis hides in the compiler and the test suite. }
~/ship-sets > ~/eventlog

:

{ Placement is the reason hop exists: mid-function hops between tab and server are the thing no nearby language offers. The eventlog is the strongest layer — specified, replay-tested — but it is a foundation, not the idea. }
~/placement 3:2 ~/eventlog

{ The store contract is specified and property-tested; ship-sets are a compiler analysis in service of placement. Foundation over mechanism. }
~/eventlog > ~/ship-sets

{ Ship-sets are what make placement honest — the compiler proves what crosses each hop; hui's handlers-by-id is a downstream consequence of closures never crossing. }
~/ship-sets > ~/hui

{ Placement over ship-sets: the analysis serves the construct; without placement there is nothing to make honest. }
~/placement > ~/ship-sets

{ The store is hop's persistence semantics; hui is one replaceable view layer. }
~/eventlog 3:1 ~/hui

{ Placement over hui, wide: hui is rendering; placement is the language. }
~/placement 3:1 ~/hui
src
spread
search