Add native SX browser article to applications docs

New article at /sx/(applications.(native-browser)) describing the vision
for a native SX desktop browser that renders s-expressions directly to
pixels via Cairo + SDL2, bypassing HTML/CSS/JS entirely.

Covers: architecture, 15-primitive platform interface, the strange loop
(browser written in SX), adoption path alongside the web, and the POC
counter demo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-27 15:18:48 +00:00
parent e6d7a08f8c
commit 83c2e23fd1
4 changed files with 1616 additions and 100 deletions

156
sx/sx/native-browser.sx Normal file
View File

@@ -0,0 +1,156 @@
(defcomp
~applications/native-browser/content
()
(~docs/page
:title "Native SX Browser"
(~docs/section
:title "The idea"
:id "idea"
(p
"SX runs in web browsers today via a WASM kernel. This works, but it's indirect — the evaluator produces HTML, the browser's layout engine positions it, the browser's paint engine draws it. Three systems, two serialization boundaries, thirty million lines of code in between.")
(p
"A native SX browser eliminates the middleman. S-expressions go in, pixels come out. No HTML parser. No CSS cascade. No JavaScript engine. No DOM. Just the SX evaluator talking to a graphics library.")
(p
"The entire rendering pipeline — parse, evaluate, lay out, paint — runs in the same process, in the same language. The browser "
(em "is")
" an SX program."))
(~docs/section
:title "Why this is feasible"
:id "feasible"
(p
"The SX kernel already exists in OCaml: parser, CEK evaluator, bytecode VM, reactive signals, component model. It's roughly 3,500 lines. A native renderer adds about 1,200 lines on top — types, layout, painting, events, and the main loop.")
(p
"The hard parts of a web browser are HTML parsing (~500K lines in Blink), CSS layout (~800K lines), JavaScript execution (~2M lines in V8), and 2,000+ Web APIs. SX needs none of them. Components declare their structure as s-expressions. Layout is a pure function of the component tree. Painting is a walk over positioned boxes.")
(div
:class "overflow-x-auto rounded border border-stone-200 my-4"
(table
:class "w-full text-left text-sm"
(thead
(tr
:class "border-b border-stone-200 bg-stone-100"
(th :class "px-3 py-2 font-medium text-stone-600" "Layer")
(th :class "px-3 py-2 font-medium text-stone-600" "Web browser")
(th :class "px-3 py-2 font-medium text-stone-600" "SX native")))
(tbody
(tr
:class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "Parse")
(td
:class "px-3 py-2 text-stone-600"
"HTML parser (~500K lines)")
(td :class "px-3 py-2 text-stone-600" "SX parser (225 lines)"))
(tr
:class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "Evaluate")
(td
:class "px-3 py-2 text-stone-600"
"V8 JavaScript engine (~2M lines)")
(td
:class "px-3 py-2 text-stone-600"
"CEK evaluator + bytecode VM (~1,300 lines)"))
(tr
:class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "Layout")
(td
:class "px-3 py-2 text-stone-600"
"CSS cascade + flexbox + grid (~800K lines)")
(td
:class "px-3 py-2 text-stone-600"
"Flexbox subset (~250 lines)"))
(tr
:class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "Paint")
(td
:class "px-3 py-2 text-stone-600"
"Composited layer tree + GPU raster")
(td
:class "px-3 py-2 text-stone-600"
"Cairo 2D draw calls (~150 lines)"))
(tr
(td :class "px-3 py-2 text-stone-700 font-semibold" "Total")
(td
:class "px-3 py-2 text-stone-700 font-semibold"
"~35 million lines")
(td
:class "px-3 py-2 text-stone-700 font-semibold"
"~5,000 lines"))))))
(~docs/section
:title "Architecture"
:id "architecture"
(p
"The native host sits alongside the existing browser and server hosts. It reuses the kernel unchanged and adds a rendering pipeline that converts SX value trees to positioned boxes to pixels.")
(~docs/code
:src (highlight
"SX source\n | sx_parser\n v\nSX value tree\n | CEK/VM eval (component expansion)\n v\nExpanded tree\n | render tree builder\n v\nRender nodes (tag, style, children, event handlers)\n | layout engine (flexbox)\n v\nPositioned boxes (x, y, width, height)\n | painter (Cairo + Pango)\n v\nPixels in window (SDL2)"
"text"))
(p
"Each layer is a pure function of the previous. Change a signal, re-evaluate the subtree, re-layout, re-paint. The reactive system from the web version works identically — "
(code "swap!")
" triggers "
(code "notify-subscribers")
" triggers repaint."))
(~docs/section
:title "The platform interface"
:id "platform"
(p
"A web browser provides thousands of APIs. The native SX browser needs about fifteen primitives — the minimal surface that SX code calls into for rendering and input:")
(~docs/code
:src (highlight
";; Window\n(window-create width height title)\n(poll-event) ; → {:type \"click\" :x 100 :y 200} or nil\n(blit) ; flush surface to screen\n\n;; Drawing\n(draw-rect x y w h color)\n(draw-rounded-rect x y w h radius color)\n(draw-text x y text font-size weight color)\n(measure-text text font-size weight) ; → {:width N :height N}\n(fill-background color)\n(set-clip x y w h)\n(clear-clip)"
"lisp"))
(p
"Everything above these primitives — layout algorithm, style resolution, hit testing, reactive scheduling, component expansion — is SX evaluating SX. The browser is a program written in the language it renders."))
(~docs/section
:title "The strange loop"
:id "strange-loop"
(p
"The native browser can be written "
(em "in SX itself")
". The layout engine is SX functions. The style parser is SX pattern matching. The event dispatcher is SX closures. The render tree is SX data. Only the fifteen leaf primitives are foreign.")
(p "This means the browser is:")
(ul
:class "list-disc list-inside space-y-2 mt-2"
(li
(strong "CID-addressable")
" — the layout engine has a content hash, the style system has a content hash, the event model has a content hash")
(li
(strong "Hot-swappable")
" — replace the layout algorithm at runtime by loading a different CID")
(li
(strong "Self-hosting")
" — the browser renders itself, if you point it at its own source")
(li
(strong "Verifiable")
" — the provenance chain from spec to bytecode to running browser is all content-addressed s-expressions")))
(~docs/section
:title "Adoption path"
:id "adoption"
(p
"The native browser doesn't need to replace the web. It sits alongside it, the same way React Native apps, Electron apps, and Flutter apps coexist with web browsers.")
(ul
:class "list-disc list-inside space-y-2 mt-2"
(li
(strong "Today:")
" SX runs in standard web browsers via the WASM kernel. No install, no app store.")
(li
(strong "Traction:")
" Sites built with SX prove the component model, reactive signals, and bytecode compilation on real traffic.")
(li
(strong "Native:")
" The same SX components render natively. Same code, no HTML middleman. Faster, lighter, offline-capable.")
(li
(strong "Platforms:")
" SDL2 gives Linux, macOS, and Windows. A future host with platform-native rendering gives iOS and Android."))
(p
"The difference from Electron: Electron ships an entire Chromium (~200MB). The native SX browser is a 5-10MB binary — the OCaml kernel plus Cairo and SDL2."))
(~docs/section
:title "Proof of concept"
:id "poc"
(p
"The POC renders a single page: a reactive counter with buttons, text, and flexbox layout. It demonstrates the full pipeline from SX source to interactive pixels.")
(~docs/code
:src (highlight
"(let ((count (signal 0)))\n (div :class \"flex flex-col items-center gap-6 p-8 bg-stone-50\"\n (h1 :class \"text-3xl font-bold text-stone-800\"\n \"SX Native Counter\")\n (div :class \"flex items-center gap-4\"\n (button :class \"bg-violet-600 text-white px-4 py-2 rounded-lg\"\n :on-click (fn () (swap! count dec)) \"\")\n (span :class \"text-4xl font-bold\" (deref count))\n (button :class \"bg-violet-600 text-white px-4 py-2 rounded-lg\"\n :on-click (fn () (swap! count inc)) \"+\"))\n (p :class \"text-stone-500 text-sm\"\n \"Native rendering — no HTML, no CSS, no JavaScript\")))"
"lisp"))
(p
"Click the button. The signal updates. The display changes. No browser involved."))))

View File

@@ -1,8 +1,56 @@
;; Navigation items for the Applications section
(define
protocols-nav-items
(list
(dict
:label "Wire Format"
:href "/sx/(applications.(protocol.wire-format))")
(dict :label "Fragments" :href "/sx/(applications.(protocol.fragments))")
(dict
:label "Resolver I/O"
:href "/sx/(applications.(protocol.resolver-io))")
(dict
:label "Internal Services"
:href "/sx/(applications.(protocol.internal-services))")
(dict
:label "ActivityPub"
:href "/sx/(applications.(protocol.activitypub))")
(dict :label "Future" :href "/sx/(applications.(protocol.future))")))
(define protocols-nav-items (list (dict :label "Wire Format" :href "/sx/(applications.(protocol.wire-format))") (dict :label "Fragments" :href "/sx/(applications.(protocol.fragments))") (dict :label "Resolver I/O" :href "/sx/(applications.(protocol.resolver-io))") (dict :label "Internal Services" :href "/sx/(applications.(protocol.internal-services))") (dict :label "ActivityPub" :href "/sx/(applications.(protocol.activitypub))") (dict :label "Future" :href "/sx/(applications.(protocol.future))")))
(define
cssx-nav-items
(list
(dict :label "Overview" :href "/sx/(applications.(cssx))")
(dict :label "Patterns" :href "/sx/(applications.(cssx.patterns))")
(dict :label "Delivery" :href "/sx/(applications.(cssx.delivery))")
(dict :label "Async CSS" :href "/sx/(applications.(cssx.async))")
(dict :label "Live Styles" :href "/sx/(applications.(cssx.live))")
(dict :label "Comparisons" :href "/sx/(applications.(cssx.comparison))")
(dict :label "Philosophy" :href "/sx/(applications.(cssx.philosophy))")))
(define cssx-nav-items (list (dict :label "Overview" :href "/sx/(applications.(cssx))") (dict :label "Patterns" :href "/sx/(applications.(cssx.patterns))") (dict :label "Delivery" :href "/sx/(applications.(cssx.delivery))") (dict :label "Async CSS" :href "/sx/(applications.(cssx.async))") (dict :label "Live Styles" :href "/sx/(applications.(cssx.live))") (dict :label "Comparisons" :href "/sx/(applications.(cssx.comparison))") (dict :label "Philosophy" :href "/sx/(applications.(cssx.philosophy))")))
(define reactive-runtime-nav-items (list (dict :label "Ref" :href "/sx/(applications.(reactive-runtime.ref))") (dict :label "Foreign FFI" :href "/sx/(applications.(reactive-runtime.foreign))") (dict :label "State Machines" :href "/sx/(applications.(reactive-runtime.machine))") (dict :label "Commands" :href "/sx/(applications.(reactive-runtime.commands))") (dict :label "Render Loop" :href "/sx/(applications.(reactive-runtime.loop))") (dict :label "Keyed Lists" :href "/sx/(applications.(reactive-runtime.keyed-lists))") (dict :label "App Shell" :href "/sx/(applications.(reactive-runtime.app-shell))")))
(define
reactive-runtime-nav-items
(list
(dict :label "Ref" :href "/sx/(applications.(reactive-runtime.ref))")
(dict
:label "Foreign FFI"
:href "/sx/(applications.(reactive-runtime.foreign))")
(dict
:label "State Machines"
:href "/sx/(applications.(reactive-runtime.machine))")
(dict
:label "Commands"
:href "/sx/(applications.(reactive-runtime.commands))")
(dict
:label "Render Loop"
:href "/sx/(applications.(reactive-runtime.loop))")
(dict
:label "Keyed Lists"
:href "/sx/(applications.(reactive-runtime.keyed-lists))")
(dict
:label "App Shell"
:href "/sx/(applications.(reactive-runtime.app-shell))")))
(define
native-browser-nav-items
(list
(dict :label "Native Browser" :href "/sx/(applications.(native-browser))")))

View File

@@ -1,99 +1,813 @@
(define docs-nav-items (list (dict :label "Introduction" :href "/sx/(language.(doc.introduction))") (dict :label "Getting Started" :href "/sx/(language.(doc.getting-started))") (dict :label "Components" :href "/sx/(language.(doc.components))") (dict :label "Evaluator" :href "/sx/(language.(doc.evaluator))") (dict :label "Primitives" :href "/sx/(language.(doc.primitives))") (dict :label "Special Forms" :href "/sx/(language.(doc.special-forms))") (dict :label "Server Rendering" :href "/sx/(language.(doc.server-rendering))")))
(define
docs-nav-items
(list
(dict :label "Introduction" :href "/sx/(language.(doc.introduction))")
(dict
:label "Getting Started"
:href "/sx/(language.(doc.getting-started))")
(dict :label "Components" :href "/sx/(language.(doc.components))")
(dict :label "Evaluator" :href "/sx/(language.(doc.evaluator))")
(dict :label "Primitives" :href "/sx/(language.(doc.primitives))")
(dict :label "Special Forms" :href "/sx/(language.(doc.special-forms))")
(dict
:label "Server Rendering"
:href "/sx/(language.(doc.server-rendering))")))
(define reference-nav-items (list (dict :label "Attributes" :href "/sx/(geography.(hypermedia.(reference.attributes)))") (dict :label "Headers" :href "/sx/(geography.(hypermedia.(reference.headers)))") (dict :label "Events" :href "/sx/(geography.(hypermedia.(reference.events)))") (dict :label "JS API" :href "/sx/(geography.(hypermedia.(reference.js-api)))")))
(define
reference-nav-items
(list
(dict
:label "Attributes"
:href "/sx/(geography.(hypermedia.(reference.attributes)))")
(dict
:label "Headers"
:href "/sx/(geography.(hypermedia.(reference.headers)))")
(dict
:label "Events"
:href "/sx/(geography.(hypermedia.(reference.events)))")
(dict
:label "JS API"
:href "/sx/(geography.(hypermedia.(reference.js-api)))")))
(define protocols-nav-items (list (dict :label "Wire Format" :href "/sx/(applications.(protocol.wire-format))") (dict :label "Fragments" :href "/sx/(applications.(protocol.fragments))") (dict :label "Resolver I/O" :href "/sx/(applications.(protocol.resolver-io))") (dict :label "Internal Services" :href "/sx/(applications.(protocol.internal-services))") (dict :label "ActivityPub" :href "/sx/(applications.(protocol.activitypub))") (dict :label "Future" :href "/sx/(applications.(protocol.future))")))
(define
protocols-nav-items
(list
(dict
:label "Wire Format"
:href "/sx/(applications.(protocol.wire-format))")
(dict :label "Fragments" :href "/sx/(applications.(protocol.fragments))")
(dict
:label "Resolver I/O"
:href "/sx/(applications.(protocol.resolver-io))")
(dict
:label "Internal Services"
:href "/sx/(applications.(protocol.internal-services))")
(dict
:label "ActivityPub"
:href "/sx/(applications.(protocol.activitypub))")
(dict :label "Future" :href "/sx/(applications.(protocol.future))")))
(define examples-nav-items (list (dict :label "Click to Load" :href "/sx/(geography.(hypermedia.(example.click-to-load)))") (dict :label "Form Submission" :href "/sx/(geography.(hypermedia.(example.form-submission)))") (dict :label "Polling" :href "/sx/(geography.(hypermedia.(example.polling)))") (dict :label "Delete Row" :href "/sx/(geography.(hypermedia.(example.delete-row)))") (dict :label "Inline Edit" :href "/sx/(geography.(hypermedia.(example.inline-edit)))") (dict :label "OOB Swaps" :href "/sx/(geography.(hypermedia.(example.oob-swaps)))") (dict :label "Lazy Loading" :href "/sx/(geography.(hypermedia.(example.lazy-loading)))") (dict :label "Infinite Scroll" :href "/sx/(geography.(hypermedia.(example.infinite-scroll)))") (dict :label "Progress Bar" :href "/sx/(geography.(hypermedia.(example.progress-bar)))") (dict :label "Active Search" :href "/sx/(geography.(hypermedia.(example.active-search)))") (dict :label "Inline Validation" :href "/sx/(geography.(hypermedia.(example.inline-validation)))") (dict :label "Value Select" :href "/sx/(geography.(hypermedia.(example.value-select)))") (dict :label "Reset on Submit" :href "/sx/(geography.(hypermedia.(example.reset-on-submit)))") (dict :label "Edit Row" :href "/sx/(geography.(hypermedia.(example.edit-row)))") (dict :label "Bulk Update" :href "/sx/(geography.(hypermedia.(example.bulk-update)))") (dict :label "Swap Positions" :href "/sx/(geography.(hypermedia.(example.swap-positions)))") (dict :label "Select Filter" :href "/sx/(geography.(hypermedia.(example.select-filter)))") (dict :label "Tabs" :href "/sx/(geography.(hypermedia.(example.tabs)))") (dict :label "Animations" :href "/sx/(geography.(hypermedia.(example.animations)))") (dict :label "Dialogs" :href "/sx/(geography.(hypermedia.(example.dialogs)))") (dict :label "Keyboard Shortcuts" :href "/sx/(geography.(hypermedia.(example.keyboard-shortcuts)))") (dict :label "PUT / PATCH" :href "/sx/(geography.(hypermedia.(example.put-patch)))") (dict :label "JSON Encoding" :href "/sx/(geography.(hypermedia.(example.json-encoding)))") (dict :label "Vals & Headers" :href "/sx/(geography.(hypermedia.(example.vals-and-headers)))") (dict :label "Loading States" :href "/sx/(geography.(hypermedia.(example.loading-states)))") (dict :label "Request Abort" :href "/sx/(geography.(hypermedia.(example.sync-replace)))") (dict :label "Retry" :href "/sx/(geography.(hypermedia.(example.retry)))")))
(define
examples-nav-items
(list
(dict
:label "Click to Load"
:href "/sx/(geography.(hypermedia.(example.click-to-load)))")
(dict
:label "Form Submission"
:href "/sx/(geography.(hypermedia.(example.form-submission)))")
(dict
:label "Polling"
:href "/sx/(geography.(hypermedia.(example.polling)))")
(dict
:label "Delete Row"
:href "/sx/(geography.(hypermedia.(example.delete-row)))")
(dict
:label "Inline Edit"
:href "/sx/(geography.(hypermedia.(example.inline-edit)))")
(dict
:label "OOB Swaps"
:href "/sx/(geography.(hypermedia.(example.oob-swaps)))")
(dict
:label "Lazy Loading"
:href "/sx/(geography.(hypermedia.(example.lazy-loading)))")
(dict
:label "Infinite Scroll"
:href "/sx/(geography.(hypermedia.(example.infinite-scroll)))")
(dict
:label "Progress Bar"
:href "/sx/(geography.(hypermedia.(example.progress-bar)))")
(dict
:label "Active Search"
:href "/sx/(geography.(hypermedia.(example.active-search)))")
(dict
:label "Inline Validation"
:href "/sx/(geography.(hypermedia.(example.inline-validation)))")
(dict
:label "Value Select"
:href "/sx/(geography.(hypermedia.(example.value-select)))")
(dict
:label "Reset on Submit"
:href "/sx/(geography.(hypermedia.(example.reset-on-submit)))")
(dict
:label "Edit Row"
:href "/sx/(geography.(hypermedia.(example.edit-row)))")
(dict
:label "Bulk Update"
:href "/sx/(geography.(hypermedia.(example.bulk-update)))")
(dict
:label "Swap Positions"
:href "/sx/(geography.(hypermedia.(example.swap-positions)))")
(dict
:label "Select Filter"
:href "/sx/(geography.(hypermedia.(example.select-filter)))")
(dict :label "Tabs" :href "/sx/(geography.(hypermedia.(example.tabs)))")
(dict
:label "Animations"
:href "/sx/(geography.(hypermedia.(example.animations)))")
(dict
:label "Dialogs"
:href "/sx/(geography.(hypermedia.(example.dialogs)))")
(dict
:label "Keyboard Shortcuts"
:href "/sx/(geography.(hypermedia.(example.keyboard-shortcuts)))")
(dict
:label "PUT / PATCH"
:href "/sx/(geography.(hypermedia.(example.put-patch)))")
(dict
:label "JSON Encoding"
:href "/sx/(geography.(hypermedia.(example.json-encoding)))")
(dict
:label "Vals & Headers"
:href "/sx/(geography.(hypermedia.(example.vals-and-headers)))")
(dict
:label "Loading States"
:href "/sx/(geography.(hypermedia.(example.loading-states)))")
(dict
:label "Request Abort"
:href "/sx/(geography.(hypermedia.(example.sync-replace)))")
(dict :label "Retry" :href "/sx/(geography.(hypermedia.(example.retry)))")))
(define cssx-nav-items (list (dict :label "Overview" :href "/sx/(applications.(cssx))") (dict :label "Patterns" :href "/sx/(applications.(cssx.patterns))") (dict :label "Delivery" :href "/sx/(applications.(cssx.delivery))") (dict :label "Async CSS" :href "/sx/(applications.(cssx.async))") (dict :label "Live Styles" :href "/sx/(applications.(cssx.live))") (dict :label "Comparisons" :href "/sx/(applications.(cssx.comparison))") (dict :label "Philosophy" :href "/sx/(applications.(cssx.philosophy))")))
(define
cssx-nav-items
(list
(dict :label "Overview" :href "/sx/(applications.(cssx))")
(dict :label "Patterns" :href "/sx/(applications.(cssx.patterns))")
(dict :label "Delivery" :href "/sx/(applications.(cssx.delivery))")
(dict :label "Async CSS" :href "/sx/(applications.(cssx.async))")
(dict :label "Live Styles" :href "/sx/(applications.(cssx.live))")
(dict :label "Comparisons" :href "/sx/(applications.(cssx.comparison))")
(dict :label "Philosophy" :href "/sx/(applications.(cssx.philosophy))")))
(define reactive-runtime-nav-items (list (dict :label "Ref" :href "/sx/(applications.(reactive-runtime.ref))") (dict :label "Foreign FFI" :href "/sx/(applications.(reactive-runtime.foreign))") (dict :label "State Machines" :href "/sx/(applications.(reactive-runtime.machine))") (dict :label "Commands" :href "/sx/(applications.(reactive-runtime.commands))") (dict :label "Render Loop" :href "/sx/(applications.(reactive-runtime.loop))") (dict :label "Keyed Lists" :href "/sx/(applications.(reactive-runtime.keyed-lists))") (dict :label "App Shell" :href "/sx/(applications.(reactive-runtime.app-shell))")))
(define
reactive-runtime-nav-items
(list
(dict :label "Ref" :href "/sx/(applications.(reactive-runtime.ref))")
(dict
:label "Foreign FFI"
:href "/sx/(applications.(reactive-runtime.foreign))")
(dict
:label "State Machines"
:href "/sx/(applications.(reactive-runtime.machine))")
(dict
:label "Commands"
:href "/sx/(applications.(reactive-runtime.commands))")
(dict
:label "Render Loop"
:href "/sx/(applications.(reactive-runtime.loop))")
(dict
:label "Keyed Lists"
:href "/sx/(applications.(reactive-runtime.keyed-lists))")
(dict
:label "App Shell"
:href "/sx/(applications.(reactive-runtime.app-shell))")))
(define essays-nav-items (list (dict :label "Why S-Expressions" :href "/sx/(etc.(essay.why-sexps))" :summary "Why SX uses s-expressions instead of HTML templates, JSX, or any other syntax.") (dict :label "The htmx/React Hybrid" :href "/sx/(etc.(essay.htmx-react-hybrid))" :summary "How SX combines the server-driven simplicity of htmx with the component model of React.") (dict :label "On-Demand CSS" :href "/sx/(etc.(essay.on-demand-css))" :summary "How SX delivers only the CSS each page needs — server scans rendered classes, sends the delta.") (dict :label "Client Reactivity" :href "/sx/(etc.(essay.client-reactivity))" :summary "Reactive UI updates without a virtual DOM, diffing library, or build step.") (dict :label "SX Native" :href "/sx/(etc.(essay.sx-native))" :summary "Extending SX beyond the browser — native desktop and mobile rendering from the same source.") (dict :label "Tail-Call Optimization" :href "/sx/(etc.(essay.tail-call-optimization))" :summary "How SX implements proper tail calls via trampolining in a language that doesn't have them.") (dict :label "Continuations" :href "/sx/(etc.(essay.continuations))" :summary "First-class continuations in a tree-walking evaluator — theory and implementation.") (dict :label "The Reflexive Web" :href "/sx/(etc.(essay.reflexive-web))" :summary "A web where pages can inspect, modify, and extend their own rendering pipeline.") (dict :label "Server Architecture" :href "/sx/(etc.(essay.server-architecture))" :summary "How SX enforces the boundary between host and embedded language, and what it looks like across targets.") (dict :label "Separate your Own Concerns" :href "/sx/(etc.(essay.separation-of-concerns))" :summary "The web's HTML/CSS/JS split separates the framework's concerns, not your application's. Real separation is domain-specific.") (dict :label "SX and AI" :href "/sx/(etc.(essay.sx-and-ai))" :summary "Why s-expressions are the most AI-friendly representation for web interfaces.") (dict :label "There Is No Alternative" :href "/sx/(etc.(essay.no-alternative))" :summary "Every attempt to escape s-expressions leads back to s-expressions. This is not an accident.") (dict :label "sx sucks" :href "/sx/(etc.(essay.sx-sucks))" :summary "An honest accounting of everything wrong with SX and why you probably shouldn't use it.") (dict :label "Tools for Fools" :href "/sx/(etc.(essay.zero-tooling))" :summary "SX was built without a code editor. No IDE, no build tools, no linters, no bundlers. What zero-tooling web development looks like.") (dict :label "React is Hypermedia" :href "/sx/(etc.(essay.react-is-hypermedia))" :summary "A React Island is a hypermedia control. Its behavior is specified in SX.") (dict :label "The Hegelian Synthesis" :href "/sx/(etc.(essay.hegelian-synthesis))" :summary "On the dialectical resolution of the hypertext/reactive contradiction. Thesis: the server renders. Antithesis: the client reacts. Synthesis: the island in the lake.") (dict :label "The Art Chain" :href "/sx/(etc.(essay.the-art-chain))" :summary "On making, self-making, and the chain of artifacts that produces itself. Ars, techne, content addressing, and why the spec is the art.") (dict :label "The True Hypermedium" :href "/sx/(etc.(essay.self-defining-medium))" :summary "The true hypermedium must define itself with itself. On ontological uniformity, the metacircular web, and why address and content should be the same stuff.") (dict :label "Hypermedia in the Age of AI" :href "/sx/(etc.(essay.hypermedia-age-of-ai))" :summary "JSON hypermedia, MCP, and why s-expressions are the format both humans and AI agents actually need.")))
(define
native-browser-nav-items
(list
(dict :label "Native Browser" :href "/sx/(applications.(native-browser))")))
(define philosophy-nav-items (list (dict :label "The SX Manifesto" :href "/sx/(etc.(philosophy.sx-manifesto))" :summary "The design principles behind SX: simplicity, self-hosting, and s-expressions all the way down.") (dict :label "Strange Loops" :href "/sx/(etc.(philosophy.godel-escher-bach))" :summary "Self-reference, and the tangled hierarchy of a language that defines itself.") (dict :label "SX and Wittgenstein" :href "/sx/(etc.(philosophy.wittgenstein))" :summary "The limits of my language are the limits of my world — Wittgenstein's philosophy and what it means for SX.") (dict :label "SX and Dennett" :href "/sx/(etc.(philosophy.dennett))" :summary "Real patterns, intentional stance, and multiple drafts — Dennett's philosophy of mind as a framework for understanding SX.") (dict :label "S-Existentialism" :href "/sx/(etc.(philosophy.existentialism))" :summary "Existence precedes essence — Sartre, Camus, and the absurd freedom of writing a Lisp for the web.") (dict :label "Platonic SX" :href "/sx/(etc.(philosophy.platonic-sx))" :summary "The allegory of the cave, the theory of Forms, and why a self-defining hypermedium participates in something Plato would have recognized.")))
(define
essays-nav-items
(list
(dict
:label "Why S-Expressions"
:href "/sx/(etc.(essay.why-sexps))"
:summary "Why SX uses s-expressions instead of HTML templates, JSX, or any other syntax.")
(dict
:label "The htmx/React Hybrid"
:href "/sx/(etc.(essay.htmx-react-hybrid))"
:summary "How SX combines the server-driven simplicity of htmx with the component model of React.")
(dict
:label "On-Demand CSS"
:href "/sx/(etc.(essay.on-demand-css))"
:summary "How SX delivers only the CSS each page needs — server scans rendered classes, sends the delta.")
(dict
:label "Client Reactivity"
:href "/sx/(etc.(essay.client-reactivity))"
:summary "Reactive UI updates without a virtual DOM, diffing library, or build step.")
(dict
:label "SX Native"
:href "/sx/(etc.(essay.sx-native))"
:summary "Extending SX beyond the browser — native desktop and mobile rendering from the same source.")
(dict
:label "Tail-Call Optimization"
:href "/sx/(etc.(essay.tail-call-optimization))"
:summary "How SX implements proper tail calls via trampolining in a language that doesn't have them.")
(dict
:label "Continuations"
:href "/sx/(etc.(essay.continuations))"
:summary "First-class continuations in a tree-walking evaluator — theory and implementation.")
(dict
:label "The Reflexive Web"
:href "/sx/(etc.(essay.reflexive-web))"
:summary "A web where pages can inspect, modify, and extend their own rendering pipeline.")
(dict
:label "Server Architecture"
:href "/sx/(etc.(essay.server-architecture))"
:summary "How SX enforces the boundary between host and embedded language, and what it looks like across targets.")
(dict
:label "Separate your Own Concerns"
:href "/sx/(etc.(essay.separation-of-concerns))"
:summary "The web's HTML/CSS/JS split separates the framework's concerns, not your application's. Real separation is domain-specific.")
(dict
:label "SX and AI"
:href "/sx/(etc.(essay.sx-and-ai))"
:summary "Why s-expressions are the most AI-friendly representation for web interfaces.")
(dict
:label "There Is No Alternative"
:href "/sx/(etc.(essay.no-alternative))"
:summary "Every attempt to escape s-expressions leads back to s-expressions. This is not an accident.")
(dict
:label "sx sucks"
:href "/sx/(etc.(essay.sx-sucks))"
:summary "An honest accounting of everything wrong with SX and why you probably shouldn't use it.")
(dict
:label "Tools for Fools"
:href "/sx/(etc.(essay.zero-tooling))"
:summary "SX was built without a code editor. No IDE, no build tools, no linters, no bundlers. What zero-tooling web development looks like.")
(dict
:label "React is Hypermedia"
:href "/sx/(etc.(essay.react-is-hypermedia))"
:summary "A React Island is a hypermedia control. Its behavior is specified in SX.")
(dict
:label "The Hegelian Synthesis"
:href "/sx/(etc.(essay.hegelian-synthesis))"
:summary "On the dialectical resolution of the hypertext/reactive contradiction. Thesis: the server renders. Antithesis: the client reacts. Synthesis: the island in the lake.")
(dict
:label "The Art Chain"
:href "/sx/(etc.(essay.the-art-chain))"
:summary "On making, self-making, and the chain of artifacts that produces itself. Ars, techne, content addressing, and why the spec is the art.")
(dict
:label "The True Hypermedium"
:href "/sx/(etc.(essay.self-defining-medium))"
:summary "The true hypermedium must define itself with itself. On ontological uniformity, the metacircular web, and why address and content should be the same stuff.")
(dict
:label "Hypermedia in the Age of AI"
:href "/sx/(etc.(essay.hypermedia-age-of-ai))"
:summary "JSON hypermedia, MCP, and why s-expressions are the format both humans and AI agents actually need.")))
(define specs-nav-items (list {:href "/sx/(language.(spec.core))" :children (list {:href "/sx/(language.(spec.parser))" :label "Parser"} {:href "/sx/(language.(spec.evaluator))" :label "Evaluator"} {:href "/sx/(language.(spec.primitives))" :label "Primitives"} {:href "/sx/(language.(spec.special-forms))" :label "Special Forms"} {:href "/sx/(language.(spec.renderer))" :label "Renderer"}) :label "Core"} {:href "/sx/(language.(spec.adapters))" :children (list {:href "/sx/(language.(spec.adapter-dom))" :label "DOM Adapter"} {:href "/sx/(language.(spec.adapter-html))" :label "HTML Adapter"} {:href "/sx/(language.(spec.adapter-sx))" :label "SX Wire Adapter"} {:href "/sx/(language.(spec.adapter-async))" :label "Async Adapter"}) :label "Adapters"} {:href "/sx/(language.(spec.browser))" :children (list {:href "/sx/(language.(spec.engine))" :label "SxEngine"} {:href "/sx/(language.(spec.orchestration))" :label "Orchestration"} {:href "/sx/(language.(spec.boot))" :label "Boot"} {:href "/sx/(language.(spec.router))" :label "Router"}) :label "Browser"} {:href "/sx/(language.(spec.reactive))" :children (list {:href "/sx/(language.(spec.signals))" :label "Signals"} {:href "/sx/(language.(spec.frames))" :label "CEK Frames"} {:href "/sx/(language.(spec.cek))" :label "CEK Machine"}) :label "Reactive"} {:href "/sx/(language.(spec.host))" :children (list {:href "/sx/(language.(spec.boundary))" :label "Boundary"} {:href "/sx/(language.(spec.forms))" :label "Forms"} {:href "/sx/(language.(spec.page-helpers))" :label "Page Helpers"}) :label "Host Interface"} {:href "/sx/(language.(spec.extensions))" :children (list {:href "/sx/(language.(spec.continuations))" :label "Continuations"} {:href "/sx/(language.(spec.callcc))" :label "call/cc"} {:href "/sx/(language.(spec.types))" :label "Types"} {:href "/sx/(language.(spec.deps))" :label "Deps"}) :label "Extensions"}))
(define
philosophy-nav-items
(list
(dict
:label "The SX Manifesto"
:href "/sx/(etc.(philosophy.sx-manifesto))"
:summary "The design principles behind SX: simplicity, self-hosting, and s-expressions all the way down.")
(dict
:label "Strange Loops"
:href "/sx/(etc.(philosophy.godel-escher-bach))"
:summary "Self-reference, and the tangled hierarchy of a language that defines itself.")
(dict
:label "SX and Wittgenstein"
:href "/sx/(etc.(philosophy.wittgenstein))"
:summary "The limits of my language are the limits of my world — Wittgenstein's philosophy and what it means for SX.")
(dict
:label "SX and Dennett"
:href "/sx/(etc.(philosophy.dennett))"
:summary "Real patterns, intentional stance, and multiple drafts — Dennett's philosophy of mind as a framework for understanding SX.")
(dict
:label "S-Existentialism"
:href "/sx/(etc.(philosophy.existentialism))"
:summary "Existence precedes essence — Sartre, Camus, and the absurd freedom of writing a Lisp for the web.")
(dict
:label "Platonic SX"
:href "/sx/(etc.(philosophy.platonic-sx))"
:summary "The allegory of the cave, the theory of Forms, and why a self-defining hypermedium participates in something Plato would have recognized.")))
(define testing-nav-items (list (dict :label "Overview" :href "/sx/(language.(test))") (dict :label "Evaluator" :href "/sx/(language.(test.eval))") (dict :label "Parser" :href "/sx/(language.(test.parser))") (dict :label "Router" :href "/sx/(language.(test.router))") (dict :label "Renderer" :href "/sx/(language.(test.render))") (dict :label "Dependencies" :href "/sx/(language.(test.deps))") (dict :label "Engine" :href "/sx/(language.(test.engine))") (dict :label "Orchestration" :href "/sx/(language.(test.orchestration))") (dict :label "Runners" :href "/sx/(language.(test.runners))")))
(define
specs-nav-items
(list {:href "/sx/(language.(spec.core))" :children (list {:href "/sx/(language.(spec.parser))" :label "Parser"} {:href "/sx/(language.(spec.evaluator))" :label "Evaluator"} {:href "/sx/(language.(spec.primitives))" :label "Primitives"} {:href "/sx/(language.(spec.special-forms))" :label "Special Forms"} {:href "/sx/(language.(spec.renderer))" :label "Renderer"}) :label "Core"} {:href "/sx/(language.(spec.adapters))" :children (list {:href "/sx/(language.(spec.adapter-dom))" :label "DOM Adapter"} {:href "/sx/(language.(spec.adapter-html))" :label "HTML Adapter"} {:href "/sx/(language.(spec.adapter-sx))" :label "SX Wire Adapter"} {:href "/sx/(language.(spec.adapter-async))" :label "Async Adapter"}) :label "Adapters"} {:href "/sx/(language.(spec.browser))" :children (list {:href "/sx/(language.(spec.engine))" :label "SxEngine"} {:href "/sx/(language.(spec.orchestration))" :label "Orchestration"} {:href "/sx/(language.(spec.boot))" :label "Boot"} {:href "/sx/(language.(spec.router))" :label "Router"}) :label "Browser"} {:href "/sx/(language.(spec.reactive))" :children (list {:href "/sx/(language.(spec.signals))" :label "Signals"} {:href "/sx/(language.(spec.frames))" :label "CEK Frames"} {:href "/sx/(language.(spec.cek))" :label "CEK Machine"}) :label "Reactive"} {:href "/sx/(language.(spec.host))" :children (list {:href "/sx/(language.(spec.boundary))" :label "Boundary"} {:href "/sx/(language.(spec.forms))" :label "Forms"} {:href "/sx/(language.(spec.page-helpers))" :label "Page Helpers"}) :label "Host Interface"} {:href "/sx/(language.(spec.extensions))" :children (list {:href "/sx/(language.(spec.continuations))" :label "Continuations"} {:href "/sx/(language.(spec.callcc))" :label "call/cc"} {:href "/sx/(language.(spec.types))" :label "Types"} {:href "/sx/(language.(spec.deps))" :label "Deps"}) :label "Extensions"}))
(define isomorphism-nav-items (list (dict :label "Roadmap" :href "/sx/(geography.(isomorphism))") (dict :label "Bundle Analyzer" :href "/sx/(geography.(isomorphism.bundle-analyzer))") (dict :label "Routing Analyzer" :href "/sx/(geography.(isomorphism.routing-analyzer))") (dict :label "Data Test" :href "/sx/(geography.(isomorphism.data-test))") (dict :label "Async IO" :href "/sx/(geography.(isomorphism.async-io))") (dict :label "Streaming" :href "/sx/(geography.(isomorphism.streaming))") (dict :label "Affinity" :href "/sx/(geography.(isomorphism.affinity))") (dict :label "Optimistic" :href "/sx/(geography.(isomorphism.optimistic))") (dict :label "Offline" :href "/sx/(geography.(isomorphism.offline))")))
(define
testing-nav-items
(list
(dict :label "Overview" :href "/sx/(language.(test))")
(dict :label "Evaluator" :href "/sx/(language.(test.eval))")
(dict :label "Parser" :href "/sx/(language.(test.parser))")
(dict :label "Router" :href "/sx/(language.(test.router))")
(dict :label "Renderer" :href "/sx/(language.(test.render))")
(dict :label "Dependencies" :href "/sx/(language.(test.deps))")
(dict :label "Engine" :href "/sx/(language.(test.engine))")
(dict :label "Orchestration" :href "/sx/(language.(test.orchestration))")
(dict :label "Runners" :href "/sx/(language.(test.runners))")))
(define cek-nav-items (list (dict :label "Overview" :href "/sx/(geography.(cek))" :summary "The CEK machine — explicit evaluator with Control, Environment, Kontinuation. Three registers, pure step function.") (dict :label "Demo" :href "/sx/(geography.(cek.demo))" :summary "Live islands evaluated by the CEK machine. Counter, computed chains, reactive attributes — all through explicit continuation frames.") (dict :label "Freeze / Thaw" :href "/sx/(geography.(cek.freeze))" :summary "Serialize a CEK state to s-expressions. Ship it, store it, content-address it. Thaw and resume anywhere.") (dict :label "Content Addressing" :href "/sx/(geography.(cek.content))" :summary "Hash frozen state to a CID. Same state = same address. Store, share, verify, reproduce.")))
(define
isomorphism-nav-items
(list
(dict :label "Roadmap" :href "/sx/(geography.(isomorphism))")
(dict
:label "Bundle Analyzer"
:href "/sx/(geography.(isomorphism.bundle-analyzer))")
(dict
:label "Routing Analyzer"
:href "/sx/(geography.(isomorphism.routing-analyzer))")
(dict :label "Data Test" :href "/sx/(geography.(isomorphism.data-test))")
(dict :label "Async IO" :href "/sx/(geography.(isomorphism.async-io))")
(dict :label "Streaming" :href "/sx/(geography.(isomorphism.streaming))")
(dict :label "Affinity" :href "/sx/(geography.(isomorphism.affinity))")
(dict :label "Optimistic" :href "/sx/(geography.(isomorphism.optimistic))")
(dict :label "Offline" :href "/sx/(geography.(isomorphism.offline))")))
(define plans-nav-items (list (dict :label "Status" :href "/sx/(etc.(plan.status))" :summary "Audit of all plans — what's done, what's in progress, and what remains.")
(dict :label "Reader Macros" :href "/sx/(etc.(plan.reader-macros))" :summary "Extensible parse-time transformations via # dispatch — datum comments, raw strings, and quote shorthand.")
(dict :label "Reader Macro Demo" :href "/sx/(etc.(plan.reader-macro-demo))" :summary "Live demo: #z3 translates SX spec declarations to SMT-LIB verification conditions.")
(dict :label "Theorem Prover" :href "/sx/(etc.(plan.theorem-prover))" :summary "prove.sx — constraint solver and property prover for SX primitives, written in SX.")
(dict :label "Self-Hosting Bootstrapper" :href "/sx/(etc.(plan.self-hosting-bootstrapper))" :summary "py.sx — an SX-to-Python translator written in SX. Complete: G0 == G1, 128/128 defines match.")
(dict :label "JS Bootstrapper" :href "/sx/(etc.(plan.js-bootstrapper))" :summary "js.sx — SX-to-JavaScript translator + ahead-of-time component compiler. Zero-runtime static sites.")
(dict :label "SX-Activity" :href "/sx/(etc.(plan.sx-activity))" :summary "A new web built on SX — executable content, shared components, parsers, and logic on IPFS, provenance on Bitcoin, all running within your own security context.")
(dict :label "Predictive Prefetching" :href "/sx/(etc.(plan.predictive-prefetch))" :summary "Prefetch missing component definitions before the user clicks — hover a link, fetch its deps, navigate client-side.")
(dict :label "Content-Addressed Components" :href "/sx/(etc.(plan.content-addressed-components))" :summary "Components identified by CID, stored on IPFS, fetched from anywhere. Canonical serialization, content verification, federated sharing.")
(dict :label "Environment Images" :href "/sx/(etc.(plan.environment-images))" :summary "Serialize evaluated environments as content-addressed images. Spec CID → image CID → every endpoint is fully executable and verifiable.")
(dict :label "Runtime Slicing" :href "/sx/(etc.(plan.runtime-slicing))" :summary "Tier the client runtime by need: L0 hypermedia (~5KB), L1 DOM ops (~8KB), L2 islands (~15KB), L3 full eval (~44KB). Sliced by slice.sx, translated by js.sx.")
(dict :label "Typed SX" :href "/sx/(etc.(plan.typed-sx))" :summary "Gradual type system with static effect checking. Optional type annotations, deftype (aliases, unions, records), and effect declarations — checked at registration time, zero runtime cost. types.sx — specced, bootstrapped, catches composition and boundary errors.")
(dict :label "Nav Redesign" :href "/sx/(etc.(plan.nav-redesign))" :summary "Replace menu bars with vertical breadcrumb navigation. Logo → section → page, arrows for siblings, children below. No dropdowns, no hamburger, infinite depth.")
(dict :label "Fragment Protocol" :href "/sx/(etc.(plan.fragment-protocol))" :summary "Structured sexp request/response for cross-service component transfer.")
(dict :label "Glue Decoupling" :href "/sx/(etc.(plan.glue-decoupling))" :summary "Eliminate all cross-app model imports via glue service layer.")
(dict :label "Social Sharing" :href "/sx/(etc.(plan.social-sharing))" :summary "OAuth-based sharing to Facebook, Instagram, Threads, Twitter/X, LinkedIn, and Mastodon.")
(dict :label "SX CI Pipeline" :href "/sx/(etc.(plan.sx-ci))" :summary "Build, test, and deploy in s-expressions — CI pipelines as SX components.")
(dict :label "Live Streaming" :href "/sx/(etc.(plan.live-streaming))" :summary "SSE and WebSocket transports for re-resolving suspense slots after initial page load — live data, real-time collaboration.")
(dict :label "sx-web Platform" :href "/sx/(etc.(plan.sx-web-platform))" :summary "sx-web.org as online development platform — embedded Claude Code, IPFS storage, sx-activity publishing, sx-ci testing. Author, stage, test, deploy from the browser.")
(dict :label "sx-forge" :href "/sx/(etc.(plan.sx-forge))" :summary "Git forge in SX — repositories, issues, pull requests, CI, permissions, and federation. Configuration as macros, diffs as components.")
(dict :label "sx-swarm" :href "/sx/(etc.(plan.sx-swarm))" :summary "Container orchestration in SX — service definitions, environment macros, deploy pipelines. Replace YAML with a real language.")
(dict :label "sx-proxy" :href "/sx/(etc.(plan.sx-proxy))" :summary "Reverse proxy in SX — routes, TLS, middleware chains, load balancing. Macros generate config from the same service definitions as the orchestrator.")
(dict :label "Async Eval Convergence" :href "/sx/(etc.(plan.async-eval-convergence))" :summary "Eliminate hand-written evaluators — bootstrap async_eval.py from the spec via an async adapter layer. One spec, one truth, zero divergence.")
(dict :label "WASM Bytecode VM" :href "/sx/(etc.(plan.wasm-bytecode-vm))" :summary "Compile SX to bytecode, run in a Rust/WASM VM. Compact wire format, no parse overhead, near-native speed, DOM via JS bindings.")
(dict :label "Generative SX" :href "/sx/(etc.(plan.generative-sx))" :summary "Programs that write themselves as they run — self-compiling specs, runtime self-extension, generative testing, seed networks.")
(dict :label "Art DAG on SX" :href "/sx/(etc.(plan.art-dag-sx))" :summary "SX endpoints as portals into media processing environments — recipes as programs, split execution across GPU/cache/live boundaries, streaming AV output.")
(dict :label "Spec Explorer" :href "/sx/(etc.(plan.spec-explorer))" :summary "The fifth ring — SX exploring itself. Per-function cards showing source, Python/JS/Z3 translations, platform dependencies, tests, proofs, and usage examples.")
(dict :label "SX Protocol" :href "/sx/(etc.(plan.sx-protocol))" :summary "S-expressions as a universal protocol for networked hypermedia — replacing URLs, HTTP verbs, query languages, and rendering with one evaluable format.")
(dict :label "Scoped Effects" :href "/sx/(etc.(plan.scoped-effects))" :summary "Algebraic effects as the unified foundation — spreads, islands, lakes, signals, and context are all instances of one primitive: a named scope with downward value, upward accumulation, and a propagation mode.")
(dict :label "Foundations" :href "/sx/(etc.(plan.foundations))" :summary "The computational floor — from scoped effects through algebraic effects and delimited continuations to the CEK machine. Why three registers are irreducible, and the three-axis model (depth, topology, linearity).")
(dict :label "Deref as Shift" :href "/sx/(etc.(plan.cek-reactive))" :summary "Phase B: replace explicit effect wrapping with implicit continuation capture. Deref inside reactive-reset performs shift, capturing the rest of the expression as the subscriber.")
(dict :label "Rust/WASM Host" :href "/sx/(etc.(plan.rust-wasm-host))" :summary "Bootstrap the SX spec to Rust, compile to WASM, replace sx-browser.js. Shared platform layer for DOM, phased rollout from parse to full parity.")
(dict :label "Isolated Evaluator" :href "/sx/(etc.(plan.isolated-evaluator))" :summary "Core/application split, shared sx-platform.js, isolated JS evaluator, Rust WASM via handle table. Only language-defining spec gets bootstrapped; everything else is runtime-evaluated .sx.")
(dict :label "Mother Language" :href "/sx/(etc.(plan.mother-language))" :summary "SX as its own compiler. OCaml as substrate (closest to CEK), Koka as alternative (compile-time linearity), ultimately self-hosting. One language, every target.")
(dict :label "sx-web" :href "/sx/(etc.(plan.sx-web))" :summary "Federated component web. Browser nodes via WebTransport, server nodes via IPFS, content-addressed SX verified by CID. In-browser editing, testing, publishing. AI composition over the federated graph.")
(dict :label "sx-host" :href "/sx/(etc.(plan.sx-host))" :summary "Universal platform primitives.")))
(define
cek-nav-items
(list
(dict
:label "Overview"
:href "/sx/(geography.(cek))"
:summary "The CEK machine — explicit evaluator with Control, Environment, Kontinuation. Three registers, pure step function.")
(dict
:label "Demo"
:href "/sx/(geography.(cek.demo))"
:summary "Live islands evaluated by the CEK machine. Counter, computed chains, reactive attributes — all through explicit continuation frames.")
(dict
:label "Freeze / Thaw"
:href "/sx/(geography.(cek.freeze))"
:summary "Serialize a CEK state to s-expressions. Ship it, store it, content-address it. Thaw and resume anywhere.")
(dict
:label "Content Addressing"
:href "/sx/(geography.(cek.content))"
:summary "Hash frozen state to a CID. Same state = same address. Store, share, verify, reproduce.")))
(define
plans-nav-items
(list
(dict
:label "Status"
:href "/sx/(etc.(plan.status))"
:summary "Audit of all plans — what's done, what's in progress, and what remains.")
(dict
:label "Reader Macros"
:href "/sx/(etc.(plan.reader-macros))"
:summary "Extensible parse-time transformations via # dispatch — datum comments, raw strings, and quote shorthand.")
(dict
:label "Reader Macro Demo"
:href "/sx/(etc.(plan.reader-macro-demo))"
:summary "Live demo: #z3 translates SX spec declarations to SMT-LIB verification conditions.")
(dict
:label "Theorem Prover"
:href "/sx/(etc.(plan.theorem-prover))"
:summary "prove.sx — constraint solver and property prover for SX primitives, written in SX.")
(dict
:label "Self-Hosting Bootstrapper"
:href "/sx/(etc.(plan.self-hosting-bootstrapper))"
:summary "py.sx — an SX-to-Python translator written in SX. Complete: G0 == G1, 128/128 defines match.")
(dict
:label "JS Bootstrapper"
:href "/sx/(etc.(plan.js-bootstrapper))"
:summary "js.sx — SX-to-JavaScript translator + ahead-of-time component compiler. Zero-runtime static sites.")
(dict
:label "SX-Activity"
:href "/sx/(etc.(plan.sx-activity))"
:summary "A new web built on SX — executable content, shared components, parsers, and logic on IPFS, provenance on Bitcoin, all running within your own security context.")
(dict
:label "Predictive Prefetching"
:href "/sx/(etc.(plan.predictive-prefetch))"
:summary "Prefetch missing component definitions before the user clicks — hover a link, fetch its deps, navigate client-side.")
(dict
:label "Content-Addressed Components"
:href "/sx/(etc.(plan.content-addressed-components))"
:summary "Components identified by CID, stored on IPFS, fetched from anywhere. Canonical serialization, content verification, federated sharing.")
(dict
:label "Environment Images"
:href "/sx/(etc.(plan.environment-images))"
:summary "Serialize evaluated environments as content-addressed images. Spec CID → image CID → every endpoint is fully executable and verifiable.")
(dict
:label "Runtime Slicing"
:href "/sx/(etc.(plan.runtime-slicing))"
:summary "Tier the client runtime by need: L0 hypermedia (~5KB), L1 DOM ops (~8KB), L2 islands (~15KB), L3 full eval (~44KB). Sliced by slice.sx, translated by js.sx.")
(dict
:label "Typed SX"
:href "/sx/(etc.(plan.typed-sx))"
:summary "Gradual type system with static effect checking. Optional type annotations, deftype (aliases, unions, records), and effect declarations — checked at registration time, zero runtime cost. types.sx — specced, bootstrapped, catches composition and boundary errors.")
(dict
:label "Nav Redesign"
:href "/sx/(etc.(plan.nav-redesign))"
:summary "Replace menu bars with vertical breadcrumb navigation. Logo → section → page, arrows for siblings, children below. No dropdowns, no hamburger, infinite depth.")
(dict
:label "Fragment Protocol"
:href "/sx/(etc.(plan.fragment-protocol))"
:summary "Structured sexp request/response for cross-service component transfer.")
(dict
:label "Glue Decoupling"
:href "/sx/(etc.(plan.glue-decoupling))"
:summary "Eliminate all cross-app model imports via glue service layer.")
(dict
:label "Social Sharing"
:href "/sx/(etc.(plan.social-sharing))"
:summary "OAuth-based sharing to Facebook, Instagram, Threads, Twitter/X, LinkedIn, and Mastodon.")
(dict
:label "SX CI Pipeline"
:href "/sx/(etc.(plan.sx-ci))"
:summary "Build, test, and deploy in s-expressions — CI pipelines as SX components.")
(dict
:label "Live Streaming"
:href "/sx/(etc.(plan.live-streaming))"
:summary "SSE and WebSocket transports for re-resolving suspense slots after initial page load — live data, real-time collaboration.")
(dict
:label "sx-web Platform"
:href "/sx/(etc.(plan.sx-web-platform))"
:summary "sx-web.org as online development platform — embedded Claude Code, IPFS storage, sx-activity publishing, sx-ci testing. Author, stage, test, deploy from the browser.")
(dict
:label "sx-forge"
:href "/sx/(etc.(plan.sx-forge))"
:summary "Git forge in SX — repositories, issues, pull requests, CI, permissions, and federation. Configuration as macros, diffs as components.")
(dict
:label "sx-swarm"
:href "/sx/(etc.(plan.sx-swarm))"
:summary "Container orchestration in SX — service definitions, environment macros, deploy pipelines. Replace YAML with a real language.")
(dict
:label "sx-proxy"
:href "/sx/(etc.(plan.sx-proxy))"
:summary "Reverse proxy in SX — routes, TLS, middleware chains, load balancing. Macros generate config from the same service definitions as the orchestrator.")
(dict
:label "Async Eval Convergence"
:href "/sx/(etc.(plan.async-eval-convergence))"
:summary "Eliminate hand-written evaluators — bootstrap async_eval.py from the spec via an async adapter layer. One spec, one truth, zero divergence.")
(dict
:label "WASM Bytecode VM"
:href "/sx/(etc.(plan.wasm-bytecode-vm))"
:summary "Compile SX to bytecode, run in a Rust/WASM VM. Compact wire format, no parse overhead, near-native speed, DOM via JS bindings.")
(dict
:label "Generative SX"
:href "/sx/(etc.(plan.generative-sx))"
:summary "Programs that write themselves as they run — self-compiling specs, runtime self-extension, generative testing, seed networks.")
(dict
:label "Art DAG on SX"
:href "/sx/(etc.(plan.art-dag-sx))"
:summary "SX endpoints as portals into media processing environments — recipes as programs, split execution across GPU/cache/live boundaries, streaming AV output.")
(dict
:label "Spec Explorer"
:href "/sx/(etc.(plan.spec-explorer))"
:summary "The fifth ring — SX exploring itself. Per-function cards showing source, Python/JS/Z3 translations, platform dependencies, tests, proofs, and usage examples.")
(dict
:label "SX Protocol"
:href "/sx/(etc.(plan.sx-protocol))"
:summary "S-expressions as a universal protocol for networked hypermedia — replacing URLs, HTTP verbs, query languages, and rendering with one evaluable format.")
(dict
:label "Scoped Effects"
:href "/sx/(etc.(plan.scoped-effects))"
:summary "Algebraic effects as the unified foundation — spreads, islands, lakes, signals, and context are all instances of one primitive: a named scope with downward value, upward accumulation, and a propagation mode.")
(dict
:label "Foundations"
:href "/sx/(etc.(plan.foundations))"
:summary "The computational floor — from scoped effects through algebraic effects and delimited continuations to the CEK machine. Why three registers are irreducible, and the three-axis model (depth, topology, linearity).")
(dict
:label "Deref as Shift"
:href "/sx/(etc.(plan.cek-reactive))"
:summary "Phase B: replace explicit effect wrapping with implicit continuation capture. Deref inside reactive-reset performs shift, capturing the rest of the expression as the subscriber.")
(dict
:label "Rust/WASM Host"
:href "/sx/(etc.(plan.rust-wasm-host))"
:summary "Bootstrap the SX spec to Rust, compile to WASM, replace sx-browser.js. Shared platform layer for DOM, phased rollout from parse to full parity.")
(dict
:label "Isolated Evaluator"
:href "/sx/(etc.(plan.isolated-evaluator))"
:summary "Core/application split, shared sx-platform.js, isolated JS evaluator, Rust WASM via handle table. Only language-defining spec gets bootstrapped; everything else is runtime-evaluated .sx.")
(dict
:label "Mother Language"
:href "/sx/(etc.(plan.mother-language))"
:summary "SX as its own compiler. OCaml as substrate (closest to CEK), Koka as alternative (compile-time linearity), ultimately self-hosting. One language, every target.")
(dict
:label "sx-web"
:href "/sx/(etc.(plan.sx-web))"
:summary "Federated component web. Browser nodes via WebTransport, server nodes via IPFS, content-addressed SX verified by CID. In-browser editing, testing, publishing. AI composition over the federated graph.")
(dict
:label "sx-host"
:href "/sx/(etc.(plan.sx-host))"
:summary "Universal platform primitives.")))
(define reactive-examples-nav-items (list {:href "/sx/(geography.(reactive.(examples.counter)))" :label "Counter"} {:href "/sx/(geography.(reactive.(examples.temperature)))" :label "Temperature"} {:href "/sx/(geography.(reactive.(examples.stopwatch)))" :label "Stopwatch"} {:href "/sx/(geography.(reactive.(examples.imperative)))" :label "Imperative"} {:href "/sx/(geography.(reactive.(examples.reactive-list)))" :label "Reactive List"} {:href "/sx/(geography.(reactive.(examples.input-binding)))" :label "Input Binding"} {:href "/sx/(geography.(reactive.(examples.portal)))" :label "Portals"} {:href "/sx/(geography.(reactive.(examples.error-boundary)))" :label "Error Boundary"} {:href "/sx/(geography.(reactive.(examples.refs)))" :label "Refs"} {:href "/sx/(geography.(reactive.(examples.dynamic-class)))" :label "Dynamic Class"} {:href "/sx/(geography.(reactive.(examples.resource)))" :label "Resource"} {:href "/sx/(geography.(reactive.(examples.transition)))" :label "Transitions"} {:href "/sx/(geography.(reactive.(examples.stores)))" :label "Stores"} {:href "/sx/(geography.(reactive.(examples.event-bridge-demo)))" :label "Event Bridge"} {:href "/sx/(geography.(reactive.(examples.defisland)))" :label "defisland"} {:href "/sx/(geography.(reactive.(examples.tests)))" :label "Tests"} {:href "/sx/(geography.(reactive.(examples.coverage)))" :label "Coverage"} {:href "/sx/(geography.(reactive.(examples.cyst)))" :label "Cyst"} {:href "/sx/(geography.(reactive.(examples.reactive-expressions)))" :label "Reactive Expressions"}))
(define
reactive-examples-nav-items
(list
{:href "/sx/(geography.(reactive.(examples.counter)))" :label "Counter"}
{:href "/sx/(geography.(reactive.(examples.temperature)))" :label "Temperature"}
{:href "/sx/(geography.(reactive.(examples.stopwatch)))" :label "Stopwatch"}
{:href "/sx/(geography.(reactive.(examples.imperative)))" :label "Imperative"}
{:href "/sx/(geography.(reactive.(examples.reactive-list)))" :label "Reactive List"}
{:href "/sx/(geography.(reactive.(examples.input-binding)))" :label "Input Binding"}
{:href "/sx/(geography.(reactive.(examples.portal)))" :label "Portals"}
{:href "/sx/(geography.(reactive.(examples.error-boundary)))" :label "Error Boundary"}
{:href "/sx/(geography.(reactive.(examples.refs)))" :label "Refs"}
{:href "/sx/(geography.(reactive.(examples.dynamic-class)))" :label "Dynamic Class"}
{:href "/sx/(geography.(reactive.(examples.resource)))" :label "Resource"}
{:href "/sx/(geography.(reactive.(examples.transition)))" :label "Transitions"}
{:href "/sx/(geography.(reactive.(examples.stores)))" :label "Stores"}
{:href "/sx/(geography.(reactive.(examples.event-bridge-demo)))" :label "Event Bridge"}
{:href "/sx/(geography.(reactive.(examples.defisland)))" :label "defisland"}
{:href "/sx/(geography.(reactive.(examples.tests)))" :label "Tests"}
{:href "/sx/(geography.(reactive.(examples.coverage)))" :label "Coverage"}
{:href "/sx/(geography.(reactive.(examples.cyst)))" :label "Cyst"}
{:href "/sx/(geography.(reactive.(examples.reactive-expressions)))" :label "Reactive Expressions"}))
(define reactive-islands-nav-items (list (dict :label "Examples" :href "/sx/(geography.(reactive.(examples)))" :summary "Live interactive islands — click the buttons, type in the inputs." :children reactive-examples-nav-items)))
(define
reactive-islands-nav-items
(list
(dict
:label "Examples"
:href "/sx/(geography.(reactive.(examples)))"
:summary "Live interactive islands — click the buttons, type in the inputs."
:children reactive-examples-nav-items)))
(define marshes-examples-nav-items (list {:href "/sx/(geography.(marshes.hypermedia-feeds))" :label "Hypermedia Feeds State"} {:href "/sx/(geography.(marshes.server-signals))" :label "Server Writes to Signals"} {:href "/sx/(geography.(marshes.on-settle))" :label "sx-on-settle"} {:href "/sx/(geography.(marshes.signal-triggers))" :label "Signal-Bound Triggers"} {:href "/sx/(geography.(marshes.view-transform))" :label "Reactive View Transform"}))
(define
marshes-examples-nav-items
(list {:href "/sx/(geography.(marshes.hypermedia-feeds))" :label "Hypermedia Feeds State"} {:href "/sx/(geography.(marshes.server-signals))" :label "Server Writes to Signals"} {:href "/sx/(geography.(marshes.on-settle))" :label "sx-on-settle"} {:href "/sx/(geography.(marshes.signal-triggers))" :label "Signal-Bound Triggers"} {:href "/sx/(geography.(marshes.view-transform))" :label "Reactive View Transform"}))
(define bootstrappers-nav-items (list (dict :label "Overview" :href "/sx/(language.(bootstrapper))") (dict :label "JavaScript" :href "/sx/(language.(bootstrapper.javascript))") (dict :label "Python" :href "/sx/(language.(bootstrapper.python))") (dict :label "Self-Hosting (py.sx)" :href "/sx/(language.(bootstrapper.self-hosting))") (dict :label "Self-Hosting JS (js.sx)" :href "/sx/(language.(bootstrapper.self-hosting-js))") (dict :label "Page Helpers" :href "/sx/(language.(bootstrapper.page-helpers))")))
(define
bootstrappers-nav-items
(list
(dict :label "Overview" :href "/sx/(language.(bootstrapper))")
(dict :label "JavaScript" :href "/sx/(language.(bootstrapper.javascript))")
(dict :label "Python" :href "/sx/(language.(bootstrapper.python))")
(dict
:label "Self-Hosting (py.sx)"
:href "/sx/(language.(bootstrapper.self-hosting))")
(dict
:label "Self-Hosting JS (js.sx)"
:href "/sx/(language.(bootstrapper.self-hosting-js))")
(dict
:label "Page Helpers"
:href "/sx/(language.(bootstrapper.page-helpers))")))
(define core-spec-items (list (dict :slug "parser" :filename "parser.sx" :title "Parser" :desc "Tokenization and parsing of SX source text into AST." :prose "The parser converts SX source text into an abstract syntax tree. It tokenizes the input into atoms, strings, numbers, keywords, and delimiters, then assembles them into nested list structures. The parser is intentionally minimal — s-expressions need very little syntax to parse. Special reader macros handle quasiquote (\\`), unquote (~), splice (~@), and the quote (') shorthand. The output is a tree of plain lists, symbols, keywords, strings, and numbers that the evaluator can walk directly.") (dict :slug "evaluator" :filename "evaluator.sx" :title "Evaluator" :desc "CEK machine evaluator." :prose "The evaluator walks the AST produced by the parser and reduces it to values. It implements lexical scoping with closures, special forms (define, let, if, cond, fn, defcomp, defmacro, quasiquote, set!, do), and function application. Macros are expanded at eval time. Component definitions (defcomp) create callable component objects that participate in the rendering pipeline. The evaluator delegates rendering expressions — HTML tags, components, fragments — to whichever adapter is active, making the same source renderable to DOM nodes, HTML strings, or SX wire format.") (dict :slug "primitives" :filename "primitives.sx" :title "Primitives" :desc "All built-in pure functions and their signatures." :prose "Primitives are the built-in functions available in every SX environment. Each entry declares a name, parameter signature, and semantics. Bootstrap compilers implement these natively per target (JavaScript, Python, etc.). The registry covers arithmetic, comparison, string manipulation, list operations, dict operations, type predicates, and control flow helpers. All primitives are pure — they take values and return values with no side effects. Platform-specific operations (DOM access, HTTP, file I/O) are provided separately via platform bridge functions, not primitives.") (dict :slug "special-forms" :filename "special-forms.sx" :title "Special Forms" :desc "All special forms — syntactic constructs with custom evaluation rules." :prose "Special forms are the syntactic constructs whose arguments are NOT evaluated before dispatch. Each form has its own evaluation rules — unlike primitives, which receive pre-evaluated values. Together with primitives, special forms define the complete language surface. The registry covers control flow (if, when, cond, case, and, or), binding (let, letrec, define, set!), functions (lambda, defcomp, defmacro), sequencing (begin, do, thread-first), quoting (quote, quasiquote), continuations (reset, shift), guards (dynamic-wind), higher-order forms (map, filter, reduce), and domain-specific definitions (defstyle, defhandler, defpage, defquery, defaction).") (dict :slug "renderer" :filename "render.sx" :title "Renderer" :desc "Shared rendering registries and utilities used by all adapters." :prose "The renderer defines what is renderable and how arguments are parsed, but not the output format. It maintains registries of known HTML tags, SVG tags, void elements, and boolean attributes. It specifies how keyword arguments on elements become HTML attributes, how children are collected, and how special attributes (class, style, data-*) are handled. All three adapters (DOM, HTML, SX wire) share these definitions so they agree on what constitutes valid markup.")))
(define
core-spec-items
(list
(dict
:slug "parser"
:filename "parser.sx"
:title "Parser"
:desc "Tokenization and parsing of SX source text into AST."
:prose "The parser converts SX source text into an abstract syntax tree. It tokenizes the input into atoms, strings, numbers, keywords, and delimiters, then assembles them into nested list structures. The parser is intentionally minimal — s-expressions need very little syntax to parse. Special reader macros handle quasiquote (\\`), unquote (~), splice (~@), and the quote (') shorthand. The output is a tree of plain lists, symbols, keywords, strings, and numbers that the evaluator can walk directly.")
(dict
:slug "evaluator"
:filename "evaluator.sx"
:title "Evaluator"
:desc "CEK machine evaluator."
:prose "The evaluator walks the AST produced by the parser and reduces it to values. It implements lexical scoping with closures, special forms (define, let, if, cond, fn, defcomp, defmacro, quasiquote, set!, do), and function application. Macros are expanded at eval time. Component definitions (defcomp) create callable component objects that participate in the rendering pipeline. The evaluator delegates rendering expressions — HTML tags, components, fragments — to whichever adapter is active, making the same source renderable to DOM nodes, HTML strings, or SX wire format.")
(dict
:slug "primitives"
:filename "primitives.sx"
:title "Primitives"
:desc "All built-in pure functions and their signatures."
:prose "Primitives are the built-in functions available in every SX environment. Each entry declares a name, parameter signature, and semantics. Bootstrap compilers implement these natively per target (JavaScript, Python, etc.). The registry covers arithmetic, comparison, string manipulation, list operations, dict operations, type predicates, and control flow helpers. All primitives are pure — they take values and return values with no side effects. Platform-specific operations (DOM access, HTTP, file I/O) are provided separately via platform bridge functions, not primitives.")
(dict
:slug "special-forms"
:filename "special-forms.sx"
:title "Special Forms"
:desc "All special forms — syntactic constructs with custom evaluation rules."
:prose "Special forms are the syntactic constructs whose arguments are NOT evaluated before dispatch. Each form has its own evaluation rules — unlike primitives, which receive pre-evaluated values. Together with primitives, special forms define the complete language surface. The registry covers control flow (if, when, cond, case, and, or), binding (let, letrec, define, set!), functions (lambda, defcomp, defmacro), sequencing (begin, do, thread-first), quoting (quote, quasiquote), continuations (reset, shift), guards (dynamic-wind), higher-order forms (map, filter, reduce), and domain-specific definitions (defstyle, defhandler, defpage, defquery, defaction).")
(dict
:slug "renderer"
:filename "render.sx"
:title "Renderer"
:desc "Shared rendering registries and utilities used by all adapters."
:prose "The renderer defines what is renderable and how arguments are parsed, but not the output format. It maintains registries of known HTML tags, SVG tags, void elements, and boolean attributes. It specifies how keyword arguments on elements become HTML attributes, how children are collected, and how special attributes (class, style, data-*) are handled. All three adapters (DOM, HTML, SX wire) share these definitions so they agree on what constitutes valid markup.")))
(define adapter-spec-items (list (dict :slug "adapter-dom" :filename "adapter-dom.sx" :title "DOM Adapter" :desc "Renders SX expressions to live DOM nodes. Browser-only." :prose "The DOM adapter renders evaluated SX expressions into live browser DOM nodes — Elements, Text nodes, and DocumentFragments. It mirrors the HTML adapter's logic but produces DOM objects instead of strings. This is the adapter used by the browser-side SX runtime for initial mount, hydration, and dynamic updates. It handles element creation, attribute setting (including event handlers and style objects), SVG namespace handling, and fragment composition.") (dict :slug "adapter-html" :filename "adapter-html.sx" :title "HTML Adapter" :desc "Renders SX expressions to HTML strings. Server-side." :prose "The HTML adapter renders evaluated SX expressions to HTML strings. It is used server-side to produce complete HTML pages and fragments. It handles void elements (self-closing tags like <br>, <img>), boolean attributes, style serialization, class merging, and proper escaping. The output is standard HTML5 that any browser can parse.") (dict :slug "adapter-sx" :filename "adapter-sx.sx" :title "SX Wire Adapter" :desc "Serializes SX for client-side rendering. Component calls stay unexpanded." :prose "The SX wire adapter serializes expressions as SX source text for transmission to the browser, where sx.js renders them client-side. Unlike the HTML adapter, component calls (~plans/content-addressed-components/name ...) are NOT expanded — they are sent to the client as-is, allowing the browser to render them with its local component registry. HTML tags ARE serialized as s-expression source. This is the format used for SX-over-HTTP responses and the page boot payload.") (dict :slug "adapter-async" :filename "adapter-async.sx" :title "Async Adapter" :desc "Async versions of HTML and SX wire adapters for server-side rendering with I/O." :prose "The async adapter provides async-aware versions of the HTML and SX wire rendering functions. It intercepts I/O operations (database queries, service calls, fragment fetches) during evaluation, awaiting them before continuing. Entry points: async-render (HTML output with awaited I/O), async-aser (SX wire format with awaited I/O). The bootstrapper emits async def and automatic await insertion for all define-async functions. This adapter is what makes server-side SX pages work with real data.")))
(define
adapter-spec-items
(list
(dict
:slug "adapter-dom"
:filename "adapter-dom.sx"
:title "DOM Adapter"
:desc "Renders SX expressions to live DOM nodes. Browser-only."
:prose "The DOM adapter renders evaluated SX expressions into live browser DOM nodes — Elements, Text nodes, and DocumentFragments. It mirrors the HTML adapter's logic but produces DOM objects instead of strings. This is the adapter used by the browser-side SX runtime for initial mount, hydration, and dynamic updates. It handles element creation, attribute setting (including event handlers and style objects), SVG namespace handling, and fragment composition.")
(dict
:slug "adapter-html"
:filename "adapter-html.sx"
:title "HTML Adapter"
:desc "Renders SX expressions to HTML strings. Server-side."
:prose "The HTML adapter renders evaluated SX expressions to HTML strings. It is used server-side to produce complete HTML pages and fragments. It handles void elements (self-closing tags like <br>, <img>), boolean attributes, style serialization, class merging, and proper escaping. The output is standard HTML5 that any browser can parse.")
(dict
:slug "adapter-sx"
:filename "adapter-sx.sx"
:title "SX Wire Adapter"
:desc "Serializes SX for client-side rendering. Component calls stay unexpanded."
:prose "The SX wire adapter serializes expressions as SX source text for transmission to the browser, where sx.js renders them client-side. Unlike the HTML adapter, component calls (~plans/content-addressed-components/name ...) are NOT expanded — they are sent to the client as-is, allowing the browser to render them with its local component registry. HTML tags ARE serialized as s-expression source. This is the format used for SX-over-HTTP responses and the page boot payload.")
(dict
:slug "adapter-async"
:filename "adapter-async.sx"
:title "Async Adapter"
:desc "Async versions of HTML and SX wire adapters for server-side rendering with I/O."
:prose "The async adapter provides async-aware versions of the HTML and SX wire rendering functions. It intercepts I/O operations (database queries, service calls, fragment fetches) during evaluation, awaiting them before continuing. Entry points: async-render (HTML output with awaited I/O), async-aser (SX wire format with awaited I/O). The bootstrapper emits async def and automatic await insertion for all define-async functions. This adapter is what makes server-side SX pages work with real data.")))
(define browser-spec-items (list (dict :slug "engine" :filename "engine.sx" :title "SxEngine" :desc "Pure logic for fetch, swap, history, SSE, triggers, morph, and indicators." :prose "The engine specifies the pure logic of the browser-side fetch/swap/history system. Like HTMX but native to SX. It defines trigger parsing (click, submit, intersect, poll, load, revealed), swap algorithms (innerHTML, outerHTML, morph, beforebegin, etc.), the morph/diff algorithm for patching existing DOM, history management (push-url, replace-url, popstate), out-of-band swap identification, Server-Sent Events parsing, retry logic with exponential backoff, request header building, response header processing, and optimistic UI updates. This file contains no browser API calls — all platform interaction is in orchestration.sx.") (dict :slug "orchestration" :filename "orchestration.sx" :title "Orchestration" :desc "Browser wiring that binds engine logic to DOM events, fetch, and lifecycle." :prose "Orchestration is the browser wiring layer. It binds the pure engine logic to actual browser APIs: DOM event listeners, fetch(), AbortController, setTimeout/setInterval, IntersectionObserver, history.pushState, and EventSource (SSE). It implements the full request lifecycle — from trigger through fetch through swap — including CSS tracking, response type detection (SX vs HTML), OOB swap processing, script activation, element boosting, and preload. Dependency is strictly one-way: orchestration depends on engine, never the reverse.") (dict :slug "boot" :filename "boot.sx" :title "Boot" :desc "Browser startup lifecycle: mount, hydrate, script processing." :prose "Boot handles the browser startup sequence and provides the public API for mounting SX content. On page load it: (1) initializes CSS tracking, (2) processes <script type=\"text/sx\"> tags (component definitions and mount directives), (3) hydrates [data-sx] elements, and (4) activates the engine on all elements. It also provides the public mount/hydrate/update/render-component API, and the head element hoisting logic that moves <meta>, <title>, and <link> tags from rendered content into <head>.") (dict :slug "router" :filename "router.sx" :title "Router" :desc "Client-side route matching — Flask-style pattern parsing, segment matching, route table search." :prose "The router module provides pure functions for matching URL paths against Flask-style route patterns (e.g. /docs/<slug>). Used by client-side routing to determine if a page can be rendered locally without a server roundtrip. split-path-segments breaks a path into segments, parse-route-pattern converts patterns into typed segment descriptors, match-route-segments tests a path against a parsed pattern returning extracted params, and find-matching-route searches a route table for the first match.")))
(define
browser-spec-items
(list
(dict
:slug "engine"
:filename "engine.sx"
:title "SxEngine"
:desc "Pure logic for fetch, swap, history, SSE, triggers, morph, and indicators."
:prose "The engine specifies the pure logic of the browser-side fetch/swap/history system. Like HTMX but native to SX. It defines trigger parsing (click, submit, intersect, poll, load, revealed), swap algorithms (innerHTML, outerHTML, morph, beforebegin, etc.), the morph/diff algorithm for patching existing DOM, history management (push-url, replace-url, popstate), out-of-band swap identification, Server-Sent Events parsing, retry logic with exponential backoff, request header building, response header processing, and optimistic UI updates. This file contains no browser API calls — all platform interaction is in orchestration.sx.")
(dict
:slug "orchestration"
:filename "orchestration.sx"
:title "Orchestration"
:desc "Browser wiring that binds engine logic to DOM events, fetch, and lifecycle."
:prose "Orchestration is the browser wiring layer. It binds the pure engine logic to actual browser APIs: DOM event listeners, fetch(), AbortController, setTimeout/setInterval, IntersectionObserver, history.pushState, and EventSource (SSE). It implements the full request lifecycle — from trigger through fetch through swap — including CSS tracking, response type detection (SX vs HTML), OOB swap processing, script activation, element boosting, and preload. Dependency is strictly one-way: orchestration depends on engine, never the reverse.")
(dict
:slug "boot"
:filename "boot.sx"
:title "Boot"
:desc "Browser startup lifecycle: mount, hydrate, script processing."
:prose "Boot handles the browser startup sequence and provides the public API for mounting SX content. On page load it: (1) initializes CSS tracking, (2) processes <script type=\"text/sx\"> tags (component definitions and mount directives), (3) hydrates [data-sx] elements, and (4) activates the engine on all elements. It also provides the public mount/hydrate/update/render-component API, and the head element hoisting logic that moves <meta>, <title>, and <link> tags from rendered content into <head>.")
(dict
:slug "router"
:filename "router.sx"
:title "Router"
:desc "Client-side route matching — Flask-style pattern parsing, segment matching, route table search."
:prose "The router module provides pure functions for matching URL paths against Flask-style route patterns (e.g. /docs/<slug>). Used by client-side routing to determine if a page can be rendered locally without a server roundtrip. split-path-segments breaks a path into segments, parse-route-pattern converts patterns into typed segment descriptors, match-route-segments tests a path against a parsed pattern returning extracted params, and find-matching-route searches a route table for the first match.")))
(define reactive-spec-items (list (dict :slug "signals" :filename "signals.sx" :title "Signals" :desc "Fine-grained reactive primitives — signal, computed, effect, batch." :prose "The signals module defines a fine-grained reactive system for client-side islands. Signals are containers for values that notify subscribers on change. Computed signals derive values lazily from other signals. Effects run side-effects when their dependencies change, with automatic cleanup. Batch coalesces multiple signal writes into a single notification pass. Island scope management ensures all signals, computeds, and effects are cleaned up when an island is removed from the DOM. The spec defines the reactive graph topology and update algorithm — each platform implements the actual signal/tracking types natively.") (dict :slug "frames" :filename "frames.sx" :title "CEK Frames" :desc "Continuation frame types for the explicit CEK machine." :prose "Frames define what to do next when a sub-evaluation completes. Each frame type is a dict with a type key and frame-specific data. IfFrame, WhenFrame, BeginFrame handle control flow. LetFrame, DefineFrame, SetFrame handle bindings. ArgFrame tracks function call argument evaluation. MapFrame, FilterFrame, ReduceFrame, ForEachFrame drive higher-order forms element by element through the CEK machine. ReactiveResetFrame and DerefFrame enable deref-as-shift — the core reactive mechanism where deref inside a reactive boundary captures the continuation as a signal subscriber.") (dict :slug "cek" :filename "cek.sx" :title "CEK Machine" :desc "Explicit CEK machine evaluator — step function, run loop, reactive shift." :prose "The CEK machine makes evaluation explicit. Every step is a pure function from state to state: Control (expression), Environment (bindings), Kontinuation (stack of frames). step-eval dispatches on expression type — literals pass through, symbols are looked up, lists dispatch on head (special forms, higher-order forms, macros, function calls). step-continue dispatches on the top frame type. Higher-order forms (map, filter, reduce, for-each, some, every?) step element by element, so deref-as-shift works inside callbacks. cek-call replaces invoke as the universal function dispatch — lambdas go through cek-run, native callables through apply.")))
(define
reactive-spec-items
(list
(dict
:slug "signals"
:filename "signals.sx"
:title "Signals"
:desc "Fine-grained reactive primitives — signal, computed, effect, batch."
:prose "The signals module defines a fine-grained reactive system for client-side islands. Signals are containers for values that notify subscribers on change. Computed signals derive values lazily from other signals. Effects run side-effects when their dependencies change, with automatic cleanup. Batch coalesces multiple signal writes into a single notification pass. Island scope management ensures all signals, computeds, and effects are cleaned up when an island is removed from the DOM. The spec defines the reactive graph topology and update algorithm — each platform implements the actual signal/tracking types natively.")
(dict
:slug "frames"
:filename "frames.sx"
:title "CEK Frames"
:desc "Continuation frame types for the explicit CEK machine."
:prose "Frames define what to do next when a sub-evaluation completes. Each frame type is a dict with a type key and frame-specific data. IfFrame, WhenFrame, BeginFrame handle control flow. LetFrame, DefineFrame, SetFrame handle bindings. ArgFrame tracks function call argument evaluation. MapFrame, FilterFrame, ReduceFrame, ForEachFrame drive higher-order forms element by element through the CEK machine. ReactiveResetFrame and DerefFrame enable deref-as-shift — the core reactive mechanism where deref inside a reactive boundary captures the continuation as a signal subscriber.")
(dict
:slug "cek"
:filename "cek.sx"
:title "CEK Machine"
:desc "Explicit CEK machine evaluator — step function, run loop, reactive shift."
:prose "The CEK machine makes evaluation explicit. Every step is a pure function from state to state: Control (expression), Environment (bindings), Kontinuation (stack of frames). step-eval dispatches on expression type — literals pass through, symbols are looked up, lists dispatch on head (special forms, higher-order forms, macros, function calls). step-continue dispatches on the top frame type. Higher-order forms (map, filter, reduce, for-each, some, every?) step element by element, so deref-as-shift works inside callbacks. cek-call replaces invoke as the universal function dispatch — lambdas go through cek-run, native callables through apply.")))
(define host-spec-items (list (dict :slug "boundary" :filename "boundary.sx" :title "Boundary" :desc "Language boundary contract — declares I/O primitives the host must provide." :prose "The boundary defines the contract between SX and its host environment. Tier 1 declares pure primitives (from primitives.sx). Tier 2 declares async I/O primitives the host must implement: fetch, async-eval, call-action, send-activity, and other operations that require network or database access. Tier 3 declares page helpers: format, highlight, scan-css-classes, parse-datetime. This is the interface every host must satisfy to run SX — framework-agnostic, universal to all targets. Boundary enforcement validates at registration time that all declared primitives are provided.") (dict :slug "forms" :filename "forms.sx" :title "Forms" :desc "Server-side definition forms — defhandler, defquery, defaction, defpage." :prose "Forms defines the server-side definition macros that compose the application layer. defhandler registers an HTTP route handler. defquery defines a read-only data source. defaction defines a mutation (write). defpage declares a client-routable page with path, auth, layout, data dependencies, and content. Each form parses &key parameter lists and creates typed definition objects. Platform-specific constructors are provided by the host — these have different bindings on server (Python/Quart) vs client (route matching only).") (dict :slug "page-helpers" :filename "page-helpers.sx" :title "Page Helpers" :desc "Pure data-transformation helpers for page rendering." :prose "Page helpers are pure functions that assist page rendering: categorizing special forms by type, formatting numbers and dates, highlighting code, scanning CSS classes, constructing page titles and descriptions. Unlike boundary I/O primitives, these are pure — they take data and return data with no side effects. They run identically on server and client. The host registers native implementations that match these declarations.")))
(define
host-spec-items
(list
(dict
:slug "boundary"
:filename "boundary.sx"
:title "Boundary"
:desc "Language boundary contract — declares I/O primitives the host must provide."
:prose "The boundary defines the contract between SX and its host environment. Tier 1 declares pure primitives (from primitives.sx). Tier 2 declares async I/O primitives the host must implement: fetch, async-eval, call-action, send-activity, and other operations that require network or database access. Tier 3 declares page helpers: format, highlight, scan-css-classes, parse-datetime. This is the interface every host must satisfy to run SX — framework-agnostic, universal to all targets. Boundary enforcement validates at registration time that all declared primitives are provided.")
(dict
:slug "forms"
:filename "forms.sx"
:title "Forms"
:desc "Server-side definition forms — defhandler, defquery, defaction, defpage."
:prose "Forms defines the server-side definition macros that compose the application layer. defhandler registers an HTTP route handler. defquery defines a read-only data source. defaction defines a mutation (write). defpage declares a client-routable page with path, auth, layout, data dependencies, and content. Each form parses &key parameter lists and creates typed definition objects. Platform-specific constructors are provided by the host — these have different bindings on server (Python/Quart) vs client (route matching only).")
(dict
:slug "page-helpers"
:filename "page-helpers.sx"
:title "Page Helpers"
:desc "Pure data-transformation helpers for page rendering."
:prose "Page helpers are pure functions that assist page rendering: categorizing special forms by type, formatting numbers and dates, highlighting code, scanning CSS classes, constructing page titles and descriptions. Unlike boundary I/O primitives, these are pure — they take data and return data with no side effects. They run identically on server and client. The host registers native implementations that match these declarations.")))
(define extension-spec-items (list (dict :slug "continuations" :filename "continuations.sx" :title "Continuations" :desc "Delimited continuations — shift/reset for suspendable rendering and cooperative scheduling." :prose "Delimited continuations capture the rest of a computation up to a delimiter. shift captures the continuation to the nearest reset as a first-class callable value. Unlike full call/cc, delimited continuations are composable — invoking one returns a value. This covers the practical use cases: suspendable server rendering, cooperative scheduling, linear async flows, wizard-style multi-step UIs, and undo. Each bootstrapper target implements the mechanism differently — generators in Python/JS, native shift/reset in Scheme, ContT in Haskell, CPS transform in Rust — but the semantics are identical. Optional extension: code that doesn't use continuations pays zero cost.") (dict :slug "callcc" :filename "callcc.sx" :title "call/cc" :desc "Full first-class continuations — call-with-current-continuation." :prose "Full call/cc captures the entire remaining computation as a first-class function — not just up to a delimiter, but all the way to the top level. Invoking the continuation abandons the current computation entirely and resumes from where it was captured. Strictly more powerful than delimited continuations, but harder to implement in targets that don't support it natively. Recommended for Scheme and Haskell targets where it's natural. Python, JavaScript, and Rust targets should prefer delimited continuations (continuations.sx) unless full escape semantics are genuinely needed. Optional extension: the continuation type is shared with continuations.sx if both are loaded.") (dict :slug "types" :filename "types.sx" :title "Types" :desc "Gradual type system — registration-time checking with zero runtime cost." :prose "The types module defines a gradual type system for SX. Type annotations on function parameters and return values are checked at registration time (when defcomp or define is evaluated), not at every call site. Base types include number, string, boolean, nil, symbol, keyword, element, any, and never. Union types (string|nil), function types, and type narrowing through control flow are supported. The system catches composition errors and boundary mismatches at definition time without any runtime overhead — unannotated code is unaffected.") (dict :slug "deps" :filename "deps.sx" :title "Deps" :desc "Component dependency analysis and IO detection — per-page bundling, transitive closure, CSS scoping." :prose "The deps module analyzes component dependency graphs and classifies components as pure or IO-dependent. Phase 1 (bundling): walks component AST bodies to find transitive ~component references, computes the minimal set needed per page, and collects per-page CSS classes from only the used components. Phase 2 (IO detection): scans component ASTs for references to IO primitive names (from boundary.sx declarations), computes transitive IO refs through the component graph, and caches the result. Components with no transitive IO refs are pure — they can render anywhere without server data. IO-dependent components must expand server-side.")))
(define
extension-spec-items
(list
(dict
:slug "continuations"
:filename "continuations.sx"
:title "Continuations"
:desc "Delimited continuations — shift/reset for suspendable rendering and cooperative scheduling."
:prose "Delimited continuations capture the rest of a computation up to a delimiter. shift captures the continuation to the nearest reset as a first-class callable value. Unlike full call/cc, delimited continuations are composable — invoking one returns a value. This covers the practical use cases: suspendable server rendering, cooperative scheduling, linear async flows, wizard-style multi-step UIs, and undo. Each bootstrapper target implements the mechanism differently — generators in Python/JS, native shift/reset in Scheme, ContT in Haskell, CPS transform in Rust — but the semantics are identical. Optional extension: code that doesn't use continuations pays zero cost.")
(dict
:slug "callcc"
:filename "callcc.sx"
:title "call/cc"
:desc "Full first-class continuations — call-with-current-continuation."
:prose "Full call/cc captures the entire remaining computation as a first-class function — not just up to a delimiter, but all the way to the top level. Invoking the continuation abandons the current computation entirely and resumes from where it was captured. Strictly more powerful than delimited continuations, but harder to implement in targets that don't support it natively. Recommended for Scheme and Haskell targets where it's natural. Python, JavaScript, and Rust targets should prefer delimited continuations (continuations.sx) unless full escape semantics are genuinely needed. Optional extension: the continuation type is shared with continuations.sx if both are loaded.")
(dict
:slug "types"
:filename "types.sx"
:title "Types"
:desc "Gradual type system — registration-time checking with zero runtime cost."
:prose "The types module defines a gradual type system for SX. Type annotations on function parameters and return values are checked at registration time (when defcomp or define is evaluated), not at every call site. Base types include number, string, boolean, nil, symbol, keyword, element, any, and never. Union types (string|nil), function types, and type narrowing through control flow are supported. The system catches composition errors and boundary mismatches at definition time without any runtime overhead — unannotated code is unaffected.")
(dict
:slug "deps"
:filename "deps.sx"
:title "Deps"
:desc "Component dependency analysis and IO detection — per-page bundling, transitive closure, CSS scoping."
:prose "The deps module analyzes component dependency graphs and classifies components as pure or IO-dependent. Phase 1 (bundling): walks component AST bodies to find transitive ~component references, computes the minimal set needed per page, and collects per-page CSS classes from only the used components. Phase 2 (IO detection): scans component ASTs for references to IO primitive names (from boundary.sx declarations), computes transitive IO refs through the component graph, and caches the result. Components with no transitive IO refs are pure — they can render anywhere without server data. IO-dependent components must expand server-side.")))
(define all-spec-items (concat core-spec-items (concat adapter-spec-items (concat browser-spec-items (concat reactive-spec-items (concat host-spec-items extension-spec-items))))))
(define
all-spec-items
(concat
core-spec-items
(concat
adapter-spec-items
(concat
browser-spec-items
(concat
reactive-spec-items
(concat host-spec-items extension-spec-items))))))
(define find-spec (fn (slug) (some (fn (item) (when (= (get item "slug") slug) item)) all-spec-items)))
(define
find-spec
(fn
(slug)
(some
(fn (item) (when (= (get item "slug") slug) item))
all-spec-items)))
(define find-current (fn (items slug) (when slug (some (fn (item) (when (ends-with? (get item "href") (str "." slug "))")) (get item "label"))) items))))
(define
find-current
(fn
(items slug)
(when
slug
(some
(fn
(item)
(when
(ends-with? (get item "href") (str "." slug "))"))
(get item "label")))
items))))
(defcomp ~nav-data/section-nav (&key items current) (<> (map (fn (item) (~shared:layout/nav-link :href (get item "href") :label (get item "label") :is-selected (when (= (get item "label") current) "true") :select-colours "aria-selected:bg-violet-200 aria-selected:text-violet-900")) items)))
(defcomp
~nav-data/section-nav
(&key items current)
(<>
(map
(fn
(item)
(~shared:layout/nav-link
:href (get item "href")
:label (get item "label")
:is-selected (when (= (get item "label") current) "true")
:select-colours "aria-selected:bg-violet-200 aria-selected:text-violet-900"))
items)))
(define sx-nav-tree {:href "/sx/" :children (list {:href "/sx/(geography)" :children (list {:href "/sx/(geography.(reactive))" :children reactive-islands-nav-items :label "Reactive Islands"} {:href "/sx/(geography.(hypermedia))" :children (list {:href "/sx/(geography.(hypermedia.(reference)))" :children reference-nav-items :label "Reference"} {:href "/sx/(geography.(hypermedia.(example)))" :children examples-nav-items :label "Examples"}) :label "Hypermedia Lakes"} {:href "/sx/(geography.(scopes))" :summary "The unified primitive beneath provide, collect!, spreads, and islands. Named scope with downward value, upward accumulation, and a dedup flag." :label "Scopes"} {:href "/sx/(geography.(provide))" :summary "Sugar for scope-with-value. Render-time dynamic scope — the substrate beneath spreads, CSSX, and script collection." :label "Provide / Emit!"} {:href "/sx/(geography.(spreads))" :summary "Child-to-parent communication across render boundaries — spread, collect!, reactive-spread, built on scopes." :label "Spreads"} {:href "/sx/(geography.(marshes))" :children marshes-examples-nav-items :summary "Where reactivity and hypermedia interpenetrate — server writes to signals, reactive transforms reshape server content, client state modifies how hypermedia is interpreted." :label "Marshes"} {:href "/sx/(geography.(isomorphism))" :children isomorphism-nav-items :label "Isomorphism"} {:href "/sx/(geography.(cek))" :children cek-nav-items :label "CEK Machine"}) :label "Geography"} {:href "/sx/(language)" :children (list {:href "/sx/(language.(doc))" :children docs-nav-items :label "Docs"} {:href "/sx/(language.(spec))" :children specs-nav-items :label "Specs"} {:href "/sx/(language.(spec.(explore.evaluator)))" :label "Spec Explorer"} {:href "/sx/(language.(bootstrapper))" :children bootstrappers-nav-items :label "Bootstrappers"} {:href "/sx/(language.(test))" :children testing-nav-items :label "Testing"}) :label "Language"} {:href "/sx/(applications)" :children (list {:href "/sx/(applications.(sx-urls))" :label "SX URLs"} {:href "/sx/(applications.(cssx))" :children cssx-nav-items :label "CSSX"} {:href "/sx/(applications.(protocol))" :children protocols-nav-items :label "Protocols"} {:href "/sx/(applications.(sx-pub))" :label "sx-pub"} {:href "/sx/(applications.(sx-tools))" :label "SX Tools"} {:href "/sx/(applications.(reactive-runtime))" :children reactive-runtime-nav-items :label "Reactive Runtime"}) :label "Applications"} {:href "/sx/(etc)" :children (list {:href "/sx/(etc.(essay))" :children essays-nav-items :label "Essays"} {:href "/sx/(etc.(philosophy))" :children philosophy-nav-items :label "Philosophy"} {:href "/sx/(etc.(plan))" :children plans-nav-items :label "Plans"}) :label "Etc"}) :label "sx"})
(define has-descendant-href? (fn (node path) (let ((children (get node "children"))) (when children (some (fn (child) (or (= (get child "href") path) (has-descendant-href? child path))) children)))))
(define
has-descendant-href?
(fn
(node path)
(let
((children (get node "children")))
(when
children
(some
(fn
(child)
(or
(= (get child "href") path)
(has-descendant-href? child path)))
children)))))
(define find-nav-match (fn (items path) (or (some (fn (item) (when (= (get item "href") path) item)) items) (some (fn (item) (when (has-descendant-href? item path) item)) items))))
(define
find-nav-match
(fn
(items path)
(or
(some (fn (item) (when (= (get item "href") path) item)) items)
(some (fn (item) (when (has-descendant-href? item path) item)) items))))
(define resolve-nav-path (fn (tree path) (let ((trail (list))) (define walk (fn (node) (let ((children (get node "children"))) (when children (let ((match (find-nav-match children path))) (when match (append! trail {:siblings children :node match}) (when (not (= (get match "href") path)) (walk match)))))))) (walk tree) (let ((depth (len trail))) (if (= depth 0) {:children (get tree "children") :depth 0 :trail trail} (let ((deepest (nth trail (- depth 1)))) {:children (get (get deepest "node") "children") :depth depth :trail trail}))))))
(define
resolve-nav-path
(fn
(tree path)
(let
((trail (list)))
(define
walk
(fn
(node)
(let
((children (get node "children")))
(when
children
(let
((match (find-nav-match children path)))
(when
match
(append! trail {:siblings children :node match})
(when (not (= (get match "href") path)) (walk match))))))))
(walk tree)
(let
((depth (len trail)))
(if
(= depth 0)
{:children (get tree "children") :depth 0 :trail trail}
(let ((deepest (nth trail (- depth 1)))) {:children (get (get deepest "node") "children") :depth depth :trail trail}))))))
(define find-nav-index (fn (items node) (let ((target-href (get node "href")) (count (len items))) (define find-loop (fn (i) (if (>= i count) 0 (if (= (get (nth items i) "href") target-href) i (find-loop (+ i 1)))))) (find-loop 0))))
(define
find-nav-index
(fn
(items node)
(let
((target-href (get node "href")) (count (len items)))
(define
find-loop
(fn
(i)
(if
(>= i count)
0
(if
(= (get (nth items i) "href") target-href)
i
(find-loop (+ i 1))))))
(find-loop 0))))

View File

@@ -1,12 +1,36 @@
(define slug->component (fn (slug prefix infix suffix) (if infix (make-symbol (str prefix slug infix slug suffix)) (make-symbol (str prefix slug suffix)))))
(define
slug->component
(fn
(slug prefix infix suffix)
(if
infix
(make-symbol (str prefix slug infix slug suffix))
(make-symbol (str prefix slug suffix)))))
(define make-page-fn (fn (default-name prefix infix suffix) (fn (slug) (if (nil? slug) (list (make-symbol default-name)) (list (slug->component slug prefix infix suffix))))))
(define
make-page-fn
(fn
(default-name prefix infix suffix)
(fn
(slug)
(if
(nil? slug)
(list (make-symbol default-name))
(list (slug->component slug prefix infix suffix))))))
(define home (fn (content) (if (nil? content) (quote (~docs-content/home-content)) content)))
(define
home
(fn
(content)
(if (nil? content) (quote (~docs-content/home-content)) content)))
(define language (fn (content) (if (nil? content) nil content)))
(define geography (fn (content) (if (nil? content) (quote (~geography/index-content)) content)))
(define
geography
(fn
(content)
(if (nil? content) (quote (~geography/index-content)) content)))
(define applications (fn (content) (if (nil? content) nil content)))
@@ -14,58 +38,632 @@
(define hypermedia (fn (content) (if (nil? content) nil content)))
(define reactive (fn (content) (if (nil? content) (quote (~reactive-islands/index/reactive-islands-index-content)) content)))
(define
reactive
(fn
(content)
(if
(nil? content)
(quote (~reactive-islands/index/reactive-islands-index-content))
content)))
(define examples (make-page-fn "~reactive-islands/demo/reactive-islands-demo-content" "~reactive-islands/demo/example-" nil ""))
(define
examples
(make-page-fn
"~reactive-islands/demo/reactive-islands-demo-content"
"~reactive-islands/demo/example-"
nil
""))
(define cek (fn (slug) (if (nil? slug) (quote (~geography/cek/cek-content)) (case slug "demo" (quote (~geography/cek/cek-demo-content)) "freeze" (quote (~geography/cek/cek-freeze-content)) "content" (quote (~geography/cek/cek-content-address-content)) :else (quote (~geography/cek/cek-content))))))
(define
cek
(fn
(slug)
(if
(nil? slug)
(quote (~geography/cek/cek-content))
(case
slug
"demo"
(quote (~geography/cek/cek-demo-content))
"freeze"
(quote (~geography/cek/cek-freeze-content))
"content"
(quote (~geography/cek/cek-content-address-content))
:else (quote (~geography/cek/cek-content))))))
(define provide (fn (content) (if (nil? content) (quote (~geography/provide-content)) content)))
(define
provide
(fn
(content)
(if (nil? content) (quote (~geography/provide-content)) content)))
(define scopes (fn (content) (if (nil? content) (quote (~geography/scopes-content)) content)))
(define
scopes
(fn
(content)
(if (nil? content) (quote (~geography/scopes-content)) content)))
(define spreads (fn (content) (if (nil? content) (quote (~geography/spreads-content)) content)))
(define
spreads
(fn
(content)
(if (nil? content) (quote (~geography/spreads-content)) content)))
(define marshes (fn (slug) (if (nil? slug) (quote (~reactive-islands/marshes/reactive-islands-marshes-content)) (case slug "hypermedia-feeds" (quote (~reactive-islands/marshes/example-hypermedia-feeds)) "server-signals" (quote (~reactive-islands/marshes/example-server-signals)) "on-settle" (quote (~reactive-islands/marshes/example-on-settle)) "signal-triggers" (quote (~reactive-islands/marshes/example-signal-triggers)) "view-transform" (quote (~reactive-islands/marshes/example-view-transform)) :else (quote (~reactive-islands/marshes/reactive-islands-marshes-content))))))
(define
marshes
(fn
(slug)
(if
(nil? slug)
(quote (~reactive-islands/marshes/reactive-islands-marshes-content))
(case
slug
"hypermedia-feeds"
(quote (~reactive-islands/marshes/example-hypermedia-feeds))
"server-signals"
(quote (~reactive-islands/marshes/example-server-signals))
"on-settle"
(quote (~reactive-islands/marshes/example-on-settle))
"signal-triggers"
(quote (~reactive-islands/marshes/example-signal-triggers))
"view-transform"
(quote (~reactive-islands/marshes/example-view-transform))
:else (quote (~reactive-islands/marshes/reactive-islands-marshes-content))))))
(define isomorphism (fn (slug) (if (nil? slug) (quote (~plans/isomorphic/plan-isomorphic-content)) (case slug "bundle-analyzer" (let ((data (helper "bundle-analyzer-data"))) (quasiquote (~analyzer/bundle-analyzer-content :pages (unquote (get data "pages")) :total-components (unquote (get data "total-components")) :total-macros (unquote (get data "total-macros")) :pure-count (unquote (get data "pure-count")) :io-count (unquote (get data "io-count"))))) "routing-analyzer" (let ((data (helper "routing-analyzer-data"))) (quasiquote (~routing-analyzer/content :pages (unquote (get data "pages")) :total-pages (unquote (get data "total-pages")) :client-count (unquote (get data "client-count")) :server-count (unquote (get data "server-count")) :registry-sample (unquote (get data "registry-sample"))))) "data-test" (let ((data (helper "data-test-data"))) (quasiquote (~data-test/content :server-time (unquote (get data "server-time")) :items (unquote (get data "items")) :phase (unquote (get data "phase")) :transport (unquote (get data "transport"))))) "async-io" (quote (~async-io-demo/content)) "affinity" (let ((data (helper "affinity-demo-data"))) (quasiquote (~affinity-demo/content :components (unquote (get data "components")) :page-plans (unquote (get data "page-plans"))))) "optimistic" (let ((data (helper "optimistic-demo-data"))) (quasiquote (~optimistic-demo/content :items (unquote (get data "items")) :server-time (unquote (get data "server-time"))))) "offline" (let ((data (helper "offline-demo-data"))) (quasiquote (~offline-demo/content :notes (unquote (get data "notes")) :server-time (unquote (get data "server-time"))))) :else (quote (~plans/isomorphic/plan-isomorphic-content))))))
(define
isomorphism
(fn
(slug)
(if
(nil? slug)
(quote (~plans/isomorphic/plan-isomorphic-content))
(case
slug
"bundle-analyzer"
(let
((data (helper "bundle-analyzer-data")))
(quasiquote
(~analyzer/bundle-analyzer-content
:pages (unquote (get data "pages"))
:total-components (unquote (get data "total-components"))
:total-macros (unquote (get data "total-macros"))
:pure-count (unquote (get data "pure-count"))
:io-count (unquote (get data "io-count")))))
"routing-analyzer"
(let
((data (helper "routing-analyzer-data")))
(quasiquote
(~routing-analyzer/content
:pages (unquote (get data "pages"))
:total-pages (unquote (get data "total-pages"))
:client-count (unquote (get data "client-count"))
:server-count (unquote (get data "server-count"))
:registry-sample (unquote (get data "registry-sample")))))
"data-test"
(let
((data (helper "data-test-data")))
(quasiquote
(~data-test/content
:server-time (unquote (get data "server-time"))
:items (unquote (get data "items"))
:phase (unquote (get data "phase"))
:transport (unquote (get data "transport")))))
"async-io"
(quote (~async-io-demo/content))
"affinity"
(let
((data (helper "affinity-demo-data")))
(quasiquote
(~affinity-demo/content
:components (unquote (get data "components"))
:page-plans (unquote (get data "page-plans")))))
"optimistic"
(let
((data (helper "optimistic-demo-data")))
(quasiquote
(~optimistic-demo/content
:items (unquote (get data "items"))
:server-time (unquote (get data "server-time")))))
"offline"
(let
((data (helper "offline-demo-data")))
(quasiquote
(~offline-demo/content
:notes (unquote (get data "notes"))
:server-time (unquote (get data "server-time")))))
:else (quote (~plans/isomorphic/plan-isomorphic-content))))))
(define doc (fn (slug) (if (nil? slug) (quote (~docs-content/docs-introduction-content)) (case slug "introduction" (quote (~docs-content/docs-introduction-content)) "getting-started" (quote (~docs-content/docs-getting-started-content)) "components" (quote (~docs-content/docs-components-content)) "evaluator" (quote (~docs-content/docs-evaluator-content)) "primitives" (let ((data (helper "primitives-data"))) (quasiquote (~docs-content/docs-primitives-content :prims (~docs/primitives-tables :primitives (unquote data))))) "special-forms" (let ((data (helper "special-forms-data"))) (quasiquote (~docs-content/docs-special-forms-content :forms (~docs/special-forms-tables :forms (unquote data))))) "server-rendering" (quote (~docs-content/docs-server-rendering-content)) :else (quote (~docs-content/docs-introduction-content))))))
(define
doc
(fn
(slug)
(if
(nil? slug)
(quote (~docs-content/docs-introduction-content))
(case
slug
"introduction"
(quote (~docs-content/docs-introduction-content))
"getting-started"
(quote (~docs-content/docs-getting-started-content))
"components"
(quote (~docs-content/docs-components-content))
"evaluator"
(quote (~docs-content/docs-evaluator-content))
"primitives"
(let
((data (helper "primitives-data")))
(quasiquote
(~docs-content/docs-primitives-content
:prims (~docs/primitives-tables :primitives (unquote data)))))
"special-forms"
(let
((data (helper "special-forms-data")))
(quasiquote
(~docs-content/docs-special-forms-content
:forms (~docs/special-forms-tables :forms (unquote data)))))
"server-rendering"
(quote (~docs-content/docs-server-rendering-content))
:else (quote (~docs-content/docs-introduction-content))))))
(define spec (fn (slug) (if (nil? slug) (quote (~specs/architecture-content)) (case slug "core" (let ((files (make-spec-files core-spec-items))) (quasiquote (~specs/overview-content :spec-title "Core Language" :spec-files (unquote files)))) "adapters" (let ((files (make-spec-files adapter-spec-items))) (quasiquote (~specs/overview-content :spec-title "Adapters" :spec-files (unquote files)))) "browser" (let ((files (make-spec-files browser-spec-items))) (quasiquote (~specs/overview-content :spec-title "Browser Runtime" :spec-files (unquote files)))) "reactive" (let ((files (make-spec-files reactive-spec-items))) (quasiquote (~specs/overview-content :spec-title "Reactive System" :spec-files (unquote files)))) "host" (let ((files (make-spec-files host-spec-items))) (quasiquote (~specs/overview-content :spec-title "Host Interface" :spec-files (unquote files)))) "extensions" (let ((files (make-spec-files extension-spec-items))) (quasiquote (~specs/overview-content :spec-title "Extensions" :spec-files (unquote files)))) :else (let ((found-spec (find-spec slug))) (if found-spec (let ((src (helper "read-spec-file" (get found-spec "filename")))) (quasiquote (~specs/detail-content :spec-title (unquote (get found-spec "title")) :spec-desc (unquote (get found-spec "desc")) :spec-filename (unquote (get found-spec "filename")) :spec-source (unquote src) :spec-prose (unquote (get found-spec "prose"))))) (quasiquote (~specs/not-found :slug (unquote slug)))))))))
(define
spec
(fn
(slug)
(if
(nil? slug)
(quote (~specs/architecture-content))
(case
slug
"core"
(let
((files (make-spec-files core-spec-items)))
(quasiquote
(~specs/overview-content
:spec-title "Core Language"
:spec-files (unquote files))))
"adapters"
(let
((files (make-spec-files adapter-spec-items)))
(quasiquote
(~specs/overview-content
:spec-title "Adapters"
:spec-files (unquote files))))
"browser"
(let
((files (make-spec-files browser-spec-items)))
(quasiquote
(~specs/overview-content
:spec-title "Browser Runtime"
:spec-files (unquote files))))
"reactive"
(let
((files (make-spec-files reactive-spec-items)))
(quasiquote
(~specs/overview-content
:spec-title "Reactive System"
:spec-files (unquote files))))
"host"
(let
((files (make-spec-files host-spec-items)))
(quasiquote
(~specs/overview-content
:spec-title "Host Interface"
:spec-files (unquote files))))
"extensions"
(let
((files (make-spec-files extension-spec-items)))
(quasiquote
(~specs/overview-content
:spec-title "Extensions"
:spec-files (unquote files))))
:else (let
((found-spec (find-spec slug)))
(if
found-spec
(let
((src (helper "read-spec-file" (get found-spec "filename"))))
(quasiquote
(~specs/detail-content
:spec-title (unquote (get found-spec "title"))
:spec-desc (unquote (get found-spec "desc"))
:spec-filename (unquote (get found-spec "filename"))
:spec-source (unquote src)
:spec-prose (unquote (get found-spec "prose")))))
(quasiquote (~specs/not-found :slug (unquote slug)))))))))
(define explore (fn (slug) (if (nil? slug) (quote (~specs/architecture-content)) (let ((found-spec (find-spec slug))) (if found-spec (let ((data (spec-explore (get found-spec "filename") (get found-spec "title") (get found-spec "desc")))) (if data (quasiquote (~specs-explorer/spec-explorer-content :data (unquote data))) (quasiquote (~specs/not-found :slug (unquote slug))))) (quasiquote (~specs/not-found :slug (unquote slug))))))))
(define
explore
(fn
(slug)
(if
(nil? slug)
(quote (~specs/architecture-content))
(let
((found-spec (find-spec slug)))
(if
found-spec
(let
((data (spec-explore (get found-spec "filename") (get found-spec "title") (get found-spec "desc"))))
(if
data
(quasiquote
(~specs-explorer/spec-explorer-content :data (unquote data)))
(quasiquote (~specs/not-found :slug (unquote slug)))))
(quasiquote (~specs/not-found :slug (unquote slug))))))))
(define make-spec-files (fn (items) (map (fn (item) (dict :title (get item "title") :desc (get item "desc") :prose (get item "prose") :filename (get item "filename") :href (str "/sx/(language.(spec." (get item "slug") "))") :source (helper "read-spec-file" (get item "filename")))) items)))
(define
make-spec-files
(fn
(items)
(map
(fn
(item)
(dict
:title (get item "title")
:desc (get item "desc")
:prose (get item "prose")
:filename (get item "filename")
:href (str "/sx/(language.(spec." (get item "slug") "))")
:source (helper "read-spec-file" (get item "filename"))))
items)))
(define bootstrapper (fn (slug) (if (nil? slug) (quote (~specs/bootstrappers-index-content)) (let ((data (helper "bootstrapper-data" slug))) (if (get data "bootstrapper-not-found") (quasiquote (~specs/not-found :slug (unquote slug))) (case slug "self-hosting" (quasiquote (~specs/bootstrapper-self-hosting-content :py-sx-source (unquote (get data "py-sx-source")) :g0-output (unquote (get data "g0-output")) :g1-output (unquote (get data "g1-output")) :defines-matched (unquote (get data "defines-matched")) :defines-total (unquote (get data "defines-total")) :g0-lines (unquote (get data "g0-lines")) :g0-bytes (unquote (get data "g0-bytes")) :verification-status (unquote (get data "verification-status")))) "self-hosting-js" (quasiquote (~specs/bootstrapper-self-hosting-js-content :js-sx-source (unquote (get data "js-sx-source")) :defines-matched (unquote (get data "defines-matched")) :defines-total (unquote (get data "defines-total")) :js-sx-lines (unquote (get data "js-sx-lines")) :verification-status (unquote (get data "verification-status")))) "python" (quasiquote (~specs/bootstrapper-py-content :bootstrapper-source (unquote (get data "bootstrapper-source")) :bootstrapped-output (unquote (get data "bootstrapped-output")))) "page-helpers" (let ((ph-data (helper "page-helpers-demo-data"))) (quasiquote (~page-helpers-demo/content :sf-categories (unquote (get ph-data "sf-categories")) :sf-total (unquote (get ph-data "sf-total")) :sf-ms (unquote (get ph-data "sf-ms")) :ref-sample (unquote (get ph-data "ref-sample")) :ref-ms (unquote (get ph-data "ref-ms")) :attr-result (unquote (get ph-data "attr-result")) :attr-ms (unquote (get ph-data "attr-ms")) :comp-source (unquote (get ph-data "comp-source")) :comp-ms (unquote (get ph-data "comp-ms")) :routing-result (unquote (get ph-data "routing-result")) :routing-ms (unquote (get ph-data "routing-ms")) :server-total-ms (unquote (get ph-data "server-total-ms")) :sf-source (unquote (get ph-data "sf-source")) :attr-detail (unquote (get ph-data "attr-detail")) :req-attrs (unquote (get ph-data "req-attrs")) :attr-keys (unquote (get ph-data "attr-keys"))))) :else (quasiquote (~specs/bootstrapper-js-content :bootstrapper-source (unquote (get data "bootstrapper-source")) :bootstrapped-output (unquote (get data "bootstrapped-output"))))))))))
(define
bootstrapper
(fn
(slug)
(if
(nil? slug)
(quote (~specs/bootstrappers-index-content))
(let
((data (helper "bootstrapper-data" slug)))
(if
(get data "bootstrapper-not-found")
(quasiquote (~specs/not-found :slug (unquote slug)))
(case
slug
"self-hosting"
(quasiquote
(~specs/bootstrapper-self-hosting-content
:py-sx-source (unquote (get data "py-sx-source"))
:g0-output (unquote (get data "g0-output"))
:g1-output (unquote (get data "g1-output"))
:defines-matched (unquote (get data "defines-matched"))
:defines-total (unquote (get data "defines-total"))
:g0-lines (unquote (get data "g0-lines"))
:g0-bytes (unquote (get data "g0-bytes"))
:verification-status (unquote (get data "verification-status"))))
"self-hosting-js"
(quasiquote
(~specs/bootstrapper-self-hosting-js-content
:js-sx-source (unquote (get data "js-sx-source"))
:defines-matched (unquote (get data "defines-matched"))
:defines-total (unquote (get data "defines-total"))
:js-sx-lines (unquote (get data "js-sx-lines"))
:verification-status (unquote (get data "verification-status"))))
"python"
(quasiquote
(~specs/bootstrapper-py-content
:bootstrapper-source (unquote (get data "bootstrapper-source"))
:bootstrapped-output (unquote (get data "bootstrapped-output"))))
"page-helpers"
(let
((ph-data (helper "page-helpers-demo-data")))
(quasiquote
(~page-helpers-demo/content
:sf-categories (unquote (get ph-data "sf-categories"))
:sf-total (unquote (get ph-data "sf-total"))
:sf-ms (unquote (get ph-data "sf-ms"))
:ref-sample (unquote (get ph-data "ref-sample"))
:ref-ms (unquote (get ph-data "ref-ms"))
:attr-result (unquote (get ph-data "attr-result"))
:attr-ms (unquote (get ph-data "attr-ms"))
:comp-source (unquote (get ph-data "comp-source"))
:comp-ms (unquote (get ph-data "comp-ms"))
:routing-result (unquote (get ph-data "routing-result"))
:routing-ms (unquote (get ph-data "routing-ms"))
:server-total-ms (unquote (get ph-data "server-total-ms"))
:sf-source (unquote (get ph-data "sf-source"))
:attr-detail (unquote (get ph-data "attr-detail"))
:req-attrs (unquote (get ph-data "req-attrs"))
:attr-keys (unquote (get ph-data "attr-keys")))))
:else (quasiquote
(~specs/bootstrapper-js-content
:bootstrapper-source (unquote (get data "bootstrapper-source"))
:bootstrapped-output (unquote (get data "bootstrapped-output"))))))))))
(define test (fn (slug) (if (nil? slug) (let ((data (helper "run-modular-tests" "all"))) (quasiquote (~testing/overview-content :server-results (unquote (get data "server-results")) :framework-source (unquote (get data "framework-source")) :eval-source (unquote (get data "eval-source")) :parser-source (unquote (get data "parser-source")) :router-source (unquote (get data "router-source")) :render-source (unquote (get data "render-source")) :deps-source (unquote (get data "deps-source")) :engine-source (unquote (get data "engine-source"))))) (case slug "runners" (quote (~testing/runners-content)) :else (let ((data (helper "run-modular-tests" slug))) (case slug "eval" (quasiquote (~testing/spec-content :spec-name "eval" :spec-title "Evaluator Tests" :spec-desc "81 tests covering the core evaluator and all primitives." :spec-source (unquote (get data "spec-source")) :framework-source (unquote (get data "framework-source")) :server-results (unquote (get data "server-results")))) "parser" (quasiquote (~testing/spec-content :spec-name "parser" :spec-title "Parser Tests" :spec-desc "39 tests covering tokenization and parsing." :spec-source (unquote (get data "spec-source")) :framework-source (unquote (get data "framework-source")) :server-results (unquote (get data "server-results")))) "router" (quasiquote (~testing/spec-content :spec-name "router" :spec-title "Router Tests" :spec-desc "18 tests covering client-side route matching." :spec-source (unquote (get data "spec-source")) :framework-source (unquote (get data "framework-source")) :server-results (unquote (get data "server-results")))) "render" (quasiquote (~testing/spec-content :spec-name "render" :spec-title "Renderer Tests" :spec-desc "23 tests covering HTML rendering." :spec-source (unquote (get data "spec-source")) :framework-source (unquote (get data "framework-source")) :server-results (unquote (get data "server-results")))) "deps" (quasiquote (~testing/spec-content :spec-name "deps" :spec-title "Dependency Analysis Tests" :spec-desc "33 tests covering component dependency analysis." :spec-source (unquote (get data "spec-source")) :framework-source (unquote (get data "framework-source")) :server-results (unquote (get data "server-results")))) "engine" (quasiquote (~testing/spec-content :spec-name "engine" :spec-title "Engine Tests" :spec-desc "37 tests covering engine pure functions." :spec-source (unquote (get data "spec-source")) :framework-source (unquote (get data "framework-source")) :server-results (unquote (get data "server-results")))) "orchestration" (quasiquote (~testing/spec-content :spec-name "orchestration" :spec-title "Orchestration Tests" :spec-desc "17 tests covering orchestration." :spec-source (unquote (get data "spec-source")) :framework-source (unquote (get data "framework-source")) :server-results (unquote (get data "server-results")))) :else (quasiquote (~testing/overview-content :server-results (unquote (get data "server-results"))))))))))
(define
test
(fn
(slug)
(if
(nil? slug)
(let
((data (helper "run-modular-tests" "all")))
(quasiquote
(~testing/overview-content
:server-results (unquote (get data "server-results"))
:framework-source (unquote (get data "framework-source"))
:eval-source (unquote (get data "eval-source"))
:parser-source (unquote (get data "parser-source"))
:router-source (unquote (get data "router-source"))
:render-source (unquote (get data "render-source"))
:deps-source (unquote (get data "deps-source"))
:engine-source (unquote (get data "engine-source")))))
(case
slug
"runners"
(quote (~testing/runners-content))
:else (let
((data (helper "run-modular-tests" slug)))
(case
slug
"eval"
(quasiquote
(~testing/spec-content
:spec-name "eval"
:spec-title "Evaluator Tests"
:spec-desc "81 tests covering the core evaluator and all primitives."
:spec-source (unquote (get data "spec-source"))
:framework-source (unquote (get data "framework-source"))
:server-results (unquote (get data "server-results"))))
"parser"
(quasiquote
(~testing/spec-content
:spec-name "parser"
:spec-title "Parser Tests"
:spec-desc "39 tests covering tokenization and parsing."
:spec-source (unquote (get data "spec-source"))
:framework-source (unquote (get data "framework-source"))
:server-results (unquote (get data "server-results"))))
"router"
(quasiquote
(~testing/spec-content
:spec-name "router"
:spec-title "Router Tests"
:spec-desc "18 tests covering client-side route matching."
:spec-source (unquote (get data "spec-source"))
:framework-source (unquote (get data "framework-source"))
:server-results (unquote (get data "server-results"))))
"render"
(quasiquote
(~testing/spec-content
:spec-name "render"
:spec-title "Renderer Tests"
:spec-desc "23 tests covering HTML rendering."
:spec-source (unquote (get data "spec-source"))
:framework-source (unquote (get data "framework-source"))
:server-results (unquote (get data "server-results"))))
"deps"
(quasiquote
(~testing/spec-content
:spec-name "deps"
:spec-title "Dependency Analysis Tests"
:spec-desc "33 tests covering component dependency analysis."
:spec-source (unquote (get data "spec-source"))
:framework-source (unquote (get data "framework-source"))
:server-results (unquote (get data "server-results"))))
"engine"
(quasiquote
(~testing/spec-content
:spec-name "engine"
:spec-title "Engine Tests"
:spec-desc "37 tests covering engine pure functions."
:spec-source (unquote (get data "spec-source"))
:framework-source (unquote (get data "framework-source"))
:server-results (unquote (get data "server-results"))))
"orchestration"
(quasiquote
(~testing/spec-content
:spec-name "orchestration"
:spec-title "Orchestration Tests"
:spec-desc "17 tests covering orchestration."
:spec-source (unquote (get data "spec-source"))
:framework-source (unquote (get data "framework-source"))
:server-results (unquote (get data "server-results"))))
:else (quasiquote
(~testing/overview-content
:server-results (unquote (get data "server-results"))))))))))
(define reference (fn (slug) (if (nil? slug) (quote (~examples/reference-index-content)) (let ((data (helper "reference-data" slug))) (case slug "attributes" (quasiquote (~reference/attrs-content :req-table (~docs/attr-table-from-data :title "Request Attributes" :attrs (unquote (get data "req-attrs"))) :beh-table (~docs/attr-table-from-data :title "Behavior Attributes" :attrs (unquote (get data "beh-attrs"))) :uniq-table (~docs/attr-table-from-data :title "Unique to sx" :attrs (unquote (get data "uniq-attrs"))))) "headers" (quasiquote (~reference/headers-content :req-table (~docs/headers-table-from-data :title "Request Headers" :headers (unquote (get data "req-headers"))) :resp-table (~docs/headers-table-from-data :title "Response Headers" :headers (unquote (get data "resp-headers"))))) "events" (quasiquote (~reference/events-content :table (~docs/two-col-table-from-data :intro "sx fires custom DOM events at various points in the request lifecycle." :col1 "Event" :col2 "Description" :items (unquote (get data "events-list"))))) "js-api" (quasiquote (~reference/js-api-content :table (~docs/two-col-table-from-data :intro "The client-side sx.js library exposes a public API for programmatic use." :col1 "Method" :col2 "Description" :items (unquote (get data "js-api-list"))))) :else (quasiquote (~reference/attrs-content :req-table (~docs/attr-table-from-data :title "Request Attributes" :attrs (unquote (get data "req-attrs"))) :beh-table (~docs/attr-table-from-data :title "Behavior Attributes" :attrs (unquote (get data "beh-attrs"))) :uniq-table (~docs/attr-table-from-data :title "Unique to sx" :attrs (unquote (get data "uniq-attrs"))))))))))
(define
reference
(fn
(slug)
(if
(nil? slug)
(quote (~examples/reference-index-content))
(let
((data (helper "reference-data" slug)))
(case
slug
"attributes"
(quasiquote
(~reference/attrs-content
:req-table (~docs/attr-table-from-data
:title "Request Attributes"
:attrs (unquote (get data "req-attrs")))
:beh-table (~docs/attr-table-from-data
:title "Behavior Attributes"
:attrs (unquote (get data "beh-attrs")))
:uniq-table (~docs/attr-table-from-data
:title "Unique to sx"
:attrs (unquote (get data "uniq-attrs")))))
"headers"
(quasiquote
(~reference/headers-content
:req-table (~docs/headers-table-from-data
:title "Request Headers"
:headers (unquote (get data "req-headers")))
:resp-table (~docs/headers-table-from-data
:title "Response Headers"
:headers (unquote (get data "resp-headers")))))
"events"
(quasiquote
(~reference/events-content
:table (~docs/two-col-table-from-data
:intro "sx fires custom DOM events at various points in the request lifecycle."
:col1 "Event"
:col2 "Description"
:items (unquote (get data "events-list")))))
"js-api"
(quasiquote
(~reference/js-api-content
:table (~docs/two-col-table-from-data
:intro "The client-side sx.js library exposes a public API for programmatic use."
:col1 "Method"
:col2 "Description"
:items (unquote (get data "js-api-list")))))
:else (quasiquote
(~reference/attrs-content
:req-table (~docs/attr-table-from-data
:title "Request Attributes"
:attrs (unquote (get data "req-attrs")))
:beh-table (~docs/attr-table-from-data
:title "Behavior Attributes"
:attrs (unquote (get data "beh-attrs")))
:uniq-table (~docs/attr-table-from-data
:title "Unique to sx"
:attrs (unquote (get data "uniq-attrs"))))))))))
(define reference-detail (fn (kind slug) (if (nil? slug) nil (case kind "attributes" (let ((data (helper "attr-detail-data" slug))) (if (get data "attr-not-found") (quasiquote (~reference/attr-not-found :slug (unquote slug))) (quasiquote (~reference/attr-detail-content :title (unquote (get data "attr-title")) :description (unquote (get data "attr-description")) :demo (unquote (get data "attr-demo")) :example-code (unquote (get data "attr-example")) :handler-code (unquote (get data "attr-handler")) :wire-placeholder-id (unquote (get data "attr-wire-id")))))) "headers" (let ((data (helper "header-detail-data" slug))) (if (get data "header-not-found") (quasiquote (~reference/attr-not-found :slug (unquote slug))) (quasiquote (~reference/header-detail-content :title (unquote (get data "header-title")) :direction (unquote (get data "header-direction")) :description (unquote (get data "header-description")) :example-code (unquote (get data "header-example")) :demo (unquote (get data "header-demo")))))) "events" (let ((data (helper "event-detail-data" slug))) (if (get data "event-not-found") (quasiquote (~reference/attr-not-found :slug (unquote slug))) (quasiquote (~reference/event-detail-content :title (unquote (get data "event-title")) :description (unquote (get data "event-description")) :example-code (unquote (get data "event-example")) :demo (unquote (get data "event-demo")))))) :else nil))))
(define
reference-detail
(fn
(kind slug)
(if
(nil? slug)
nil
(case
kind
"attributes"
(let
((data (helper "attr-detail-data" slug)))
(if
(get data "attr-not-found")
(quasiquote (~reference/attr-not-found :slug (unquote slug)))
(quasiquote
(~reference/attr-detail-content
:title (unquote (get data "attr-title"))
:description (unquote (get data "attr-description"))
:demo (unquote (get data "attr-demo"))
:example-code (unquote (get data "attr-example"))
:handler-code (unquote (get data "attr-handler"))
:wire-placeholder-id (unquote (get data "attr-wire-id"))))))
"headers"
(let
((data (helper "header-detail-data" slug)))
(if
(get data "header-not-found")
(quasiquote (~reference/attr-not-found :slug (unquote slug)))
(quasiquote
(~reference/header-detail-content
:title (unquote (get data "header-title"))
:direction (unquote (get data "header-direction"))
:description (unquote (get data "header-description"))
:example-code (unquote (get data "header-example"))
:demo (unquote (get data "header-demo"))))))
"events"
(let
((data (helper "event-detail-data" slug)))
(if
(get data "event-not-found")
(quasiquote (~reference/attr-not-found :slug (unquote slug)))
(quasiquote
(~reference/event-detail-content
:title (unquote (get data "event-title"))
:description (unquote (get data "event-description"))
:example-code (unquote (get data "event-example"))
:demo (unquote (get data "event-demo"))))))
:else nil))))
(define example (fn (slug) (if (nil? slug) nil (list (slug->component slug "~examples-content/example-" nil "")))))
(define
example
(fn
(slug)
(if
(nil? slug)
nil
(list (slug->component slug "~examples-content/example-" nil "")))))
(define sx-urls (fn (slug) (quote (~sx-urls/urls-content))))
(define cssx (make-page-fn "~cssx/overview-content" "~cssx/" nil "-content"))
(define protocol (make-page-fn "~protocols/wire-format-content" "~protocols/" nil "-content"))
(define
protocol
(make-page-fn "~protocols/wire-format-content" "~protocols/" nil "-content"))
(define sx-pub (fn (slug) (if (nil? slug) (quote (~sx-pub/overview-content)) nil)))
(define
sx-pub
(fn (slug) (if (nil? slug) (quote (~sx-pub/overview-content)) nil)))
(define sx-tools (fn (&key title &rest args) (quasiquote (~sx-tools/overview-content :title (unquote (or title "SX Tools")) (splice-unquote args)))))
(define
sx-tools
(fn
(&key title &rest args)
(quasiquote
(~sx-tools/overview-content
:title (unquote (or title "SX Tools"))
(splice-unquote args)))))
(define tools (fn (content) (if (nil? content) nil content)))
(define services (fn (&key title &rest args) (quasiquote (~services-tools/overview-content :title (unquote (or title "Services")) (splice-unquote args)))))
(define
services
(fn
(&key title &rest args)
(quasiquote
(~services-tools/overview-content
:title (unquote (or title "Services"))
(splice-unquote args)))))
(define reactive-runtime (make-page-fn "~reactive-runtime/overview-content" "~reactive-runtime/" nil "-content"))
(define
reactive-runtime
(make-page-fn
"~reactive-runtime/overview-content"
"~reactive-runtime/"
nil
"-content"))
(define essay (make-page-fn "~essays/index/essays-index-content" "~essays/" "/essay-" ""))
(define
native-browser
(make-page-fn
"~applications/native-browser/content"
"~applications/native-browser/"
nil
"-content"))
(define philosophy (fn (slug) (if (nil? slug) (quote (~essays/philosophy-index/content)) (case slug "sx-manifesto" (quote (~essay-sx-manifesto)) "godel-escher-bach" (quote (~essays/godel-escher-bach/essay-godel-escher-bach)) "wittgenstein" (quote (~essays/sx-and-wittgenstein/essay-sx-and-wittgenstein)) "dennett" (quote (~essays/sx-and-dennett/essay-sx-and-dennett)) "existentialism" (quote (~essays/s-existentialism/essay-s-existentialism)) "platonic-sx" (quote (~essays/platonic-sx/essay-platonic-sx)) :else (quote (~essays/philosophy-index/content))))))
(define
essay
(make-page-fn "~essays/index/essays-index-content" "~essays/" "/essay-" ""))
(define plan (make-page-fn "~plans/index/plans-index-content" "~plans/" "/plan-" "-content"))
(define
philosophy
(fn
(slug)
(if
(nil? slug)
(quote (~essays/philosophy-index/content))
(case
slug
"sx-manifesto"
(quote (~essay-sx-manifesto))
"godel-escher-bach"
(quote (~essays/godel-escher-bach/essay-godel-escher-bach))
"wittgenstein"
(quote (~essays/sx-and-wittgenstein/essay-sx-and-wittgenstein))
"dennett"
(quote (~essays/sx-and-dennett/essay-sx-and-dennett))
"existentialism"
(quote (~essays/s-existentialism/essay-s-existentialism))
"platonic-sx"
(quote (~essays/platonic-sx/essay-platonic-sx))
:else (quote (~essays/philosophy-index/content))))))
(define
plan
(make-page-fn
"~plans/index/plans-index-content"
"~plans/"
"/plan-"
"-content"))