Files
rose-ash/shared/static/wasm/sx/page-helpers.sxbc
giles e0070041d6 Add .sxbc s-expression bytecode format
Bytecode modules are now serialized as s-expressions (.sxbc) in addition
to JSON (.sxbc.json). The .sxbc format is the canonical representation —
content-addressable, parseable by the SX parser, and suitable for CID
referencing. Annotation layers (source maps, variable names, tests, docs)
can reference the bytecode CID without polluting the bytecode itself.

Format: (sxbc version hash (code :arity N :bytecode (...) :constants (...)))

The browser loader tries .sxbc first (via load-sxbc kernel primitive),
falls back to .sxbc.json. Caddy needs .sxbc MIME type to serve the new
format (currently 404s, JSON fallback works).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 14:16:22 +00:00

373 lines
14 KiB
Plaintext

(sxbc 1 "c2d5bf6a702b8eb7"
(code
:bytecode (1 1 0 1 2 0 1 3 0 1 4 0 1 5 0 1 6 0 1 7 0 1 8 0 1 9 0 1 4 0 1 10 0 1 11 0 1 12 0 1 13 0 1 14 0 1 8 0 1 15 0 1 4 0 1 16 0 1 17 0 1 18 0 1 4 0 1 19 0 1 13 0 1 20 0 1 6 0 1 21 0 1 22 0 1 23 0 1 8 0 1 24 0 1 8 0 1 25 0 1 11 0 1 26 0 1 13 0 1 27 0 1 22 0 1 28 0 1 4 0 1 29 0 1 4 0 1 30 0 1 8 0 1 31 0 1 13 0 1 32 0 1 33 0 1 34 0 1 4 0 1 35 0 1 6 0 1 36 0 1 2 0 1 37 0 1 6 0 1 38 0 1 2 0 1 39 0 1 6 0 1 40 0 1 13 0 1 41 0 1 2 0 1 42 0 1 33 0 1 43 0 1 13 0 1 44 0 1 22 0 65 35 0 128 0 0 5 51 46 0 128 45 0 5 51 48 0 128 47 0 5 51 50 0 128 49 0 5 51 52 0 128 51 0 5 51 54 0 128 53 0 5 51 56 0 128 55 0 5 51 58 0 128 57 0 5 51 60 0 128 59 0 5 51 62 0 128 61 0 5 51 64 0 128 63 0 5 51 66 0 128 65 0 50)
:constants (
"special-form-category-map"
"defmacro"
"Functions & Components"
"for-each"
"Higher-Order Forms"
"defpage"
"Domain Definitions"
"let"
"Binding"
"filter"
"shift"
"Continuations"
"and"
"Control Flow"
"set!"
"map-indexed"
"dynamic-wind"
"Guards"
"reduce"
"cond"
"defquery"
"->"
"Sequencing & Threading"
"let*"
"define"
"reset"
"case"
"do"
"map"
"some"
"letrec"
"if"
"quote"
"Quoting"
"every?"
"defhandler"
"fn"
"defstyle"
"lambda"
"defaction"
"or"
"defcomp"
"quasiquote"
"when"
"begin"
"extract-define-kwargs"
(code :arity 1
:bytecode (65 0 0 17 1 16 0 1 1 0 52 0 0 2 17 2 16 2 52 2 0 1 17 3 51 4 0 1 3 1 2 1 1 1 6 0 16 3 52 5 0 2 52 3 0 2 5 16 1 50)
:constants (
"slice"
2
"len"
"for-each"
(code :arity 1 :upvalue-count 3
:bytecode (16 0 1 2 0 52 1 0 2 18 0 52 0 0 2 6 33 20 0 5 18 1 16 0 52 5 0 2 52 4 0 1 1 6 0 52 3 0 2 33 94 0 20 7 0 18 1 16 0 52 5 0 2 48 1 17 1 18 1 16 0 1 2 0 52 1 0 2 52 5 0 2 17 2 18 2 16 1 16 2 52 4 0 1 1 9 0 52 3 0 2 33 29 0 1 11 0 1 13 0 20 15 0 16 2 52 14 0 2 52 12 0 2 1 16 0 52 10 0 3 32 6 0 16 2 52 10 0 1 52 8 0 3 32 1 0 2 50)
:constants (
"<"
"+"
1
"="
"type-of"
"nth"
"keyword"
"keyword-name"
"dict-set!"
"list"
"str"
"("
"join"
" "
"map"
"serialize"
")"))
"range"
0))
"categorize-special-forms"
(code :arity 1
:bytecode (65 0 0 17 1 51 1 0 1 1 16 0 52 0 0 2 5 16 1 50)
:constants (
"for-each"
(code :arity 1 :upvalue-count 1
:bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 6 33 59 0 5 16 0 52 4 0 1 1 5 0 52 3 0 2 6 33 41 0 5 16 0 52 6 0 1 52 1 0 1 1 7 0 52 0 0 2 6 33 19 0 5 20 8 0 16 0 52 6 0 1 48 1 1 9 0 52 0 0 2 33 175 0 16 0 1 11 0 52 10 0 2 17 1 20 12 0 16 0 48 1 17 2 20 14 0 16 1 52 13 0 2 6 34 4 0 5 1 15 0 17 3 18 0 16 3 52 17 0 2 52 16 0 1 33 15 0 18 0 16 3 52 2 0 0 52 18 0 3 32 1 0 2 5 20 19 0 18 0 16 3 52 13 0 2 1 20 0 16 2 1 20 0 52 13 0 2 6 34 4 0 5 1 21 0 1 22 0 16 2 1 22 0 52 13 0 2 6 34 4 0 5 1 21 0 1 23 0 16 2 1 23 0 52 13 0 2 6 34 4 0 5 1 21 0 1 24 0 16 2 1 24 0 52 13 0 2 6 34 4 0 5 1 21 0 1 25 0 16 1 65 5 0 49 2 32 1 0 2 50)
:constants (
"="
"type-of"
"list"
">="
"len"
2
"first"
"symbol"
"symbol-name"
"define-special-form"
"nth"
1
"extract-define-kwargs"
"get"
"special-form-category-map"
"Other"
"not"
"has-key?"
"dict-set!"
"append!"
"doc"
""
"example"
"tail-position"
"syntax"
"name"))))
"build-ref-items-with-href"
(code :arity 4
:bytecode (51 1 0 1 3 1 2 1 1 16 0 52 0 0 2 50)
:constants (
"map"
(code :arity 1 :upvalue-count 3
:bytecode (18 0 1 1 0 52 0 0 2 33 90 0 16 0 1 3 0 52 2 0 2 17 1 16 0 1 4 0 52 2 0 2 17 2 16 0 1 5 0 52 2 0 2 17 3 1 6 0 16 3 6 33 12 0 5 51 8 0 1 1 18 1 52 7 0 2 33 11 0 18 2 16 1 52 9 0 2 32 1 0 2 1 10 0 16 3 1 11 0 16 2 1 12 0 16 1 65 4 0 32 64 0 16 0 1 3 0 52 2 0 2 17 1 16 0 1 4 0 52 2 0 2 17 2 1 6 0 51 8 0 1 1 18 1 52 7 0 2 33 11 0 18 2 16 1 52 9 0 2 32 1 0 2 1 11 0 16 2 1 12 0 16 1 65 3 0 50)
:constants (
"="
3
"nth"
0
1
2
"href"
"some"
(code :arity 1 :upvalue-count 1
:bytecode (16 0 18 0 52 0 0 2 50)
:constants (
"="))
"str"
"exists"
"desc"
"name"))))
"build-reference-data"
(code :arity 3
:bytecode (16 0 6 1 0 0 52 1 0 2 33 82 0 5 1 2 0 20 3 0 16 1 1 2 0 52 4 0 2 1 5 0 16 2 1 6 0 48 4 1 7 0 20 3 0 16 1 1 7 0 52 4 0 2 1 5 0 16 2 1 6 0 48 4 1 8 0 20 3 0 16 1 1 8 0 52 4 0 2 1 5 0 16 2 1 6 0 48 4 65 3 0 32 227 0 6 1 9 0 52 1 0 2 33 57 0 5 1 10 0 20 3 0 16 1 1 10 0 52 4 0 2 1 11 0 16 2 1 6 0 48 4 1 12 0 20 3 0 16 1 1 12 0 52 4 0 2 1 11 0 16 2 1 6 0 48 4 65 2 0 32 159 0 6 1 13 0 52 1 0 2 33 32 0 5 1 14 0 20 3 0 16 1 1 14 0 52 4 0 2 1 15 0 16 2 1 16 0 48 4 65 1 0 32 116 0 6 1 17 0 52 1 0 2 33 26 0 5 1 18 0 51 20 0 16 1 1 18 0 52 4 0 2 52 19 0 2 65 1 0 32 79 0 5 1 2 0 20 3 0 16 1 1 2 0 52 4 0 2 1 5 0 16 2 1 6 0 48 4 1 7 0 20 3 0 16 1 1 7 0 52 4 0 2 1 5 0 16 2 1 6 0 48 4 1 8 0 20 3 0 16 1 1 8 0 52 4 0 2 1 5 0 16 2 1 6 0 48 4 65 3 0 50)
:constants (
"attributes"
"="
"req-attrs"
"build-ref-items-with-href"
"get"
"/geography/hypermedia/reference/attributes/"
3
"beh-attrs"
"uniq-attrs"
"headers"
"req-headers"
"/geography/hypermedia/reference/headers/"
"resp-headers"
"events"
"events-list"
"/geography/hypermedia/reference/events/"
2
"js-api"
"js-api-list"
"map"
(code :arity 1
:bytecode (1 0 0 16 0 1 2 0 52 1 0 2 1 3 0 16 0 1 4 0 52 1 0 2 65 2 0 50)
:constants (
"desc"
"nth"
1
"name"
0))))
"build-attr-detail"
(code :arity 2
:bytecode (16 1 52 0 0 1 33 10 0 1 1 0 3 65 1 0 32 108 0 1 2 0 16 1 1 4 0 52 3 0 2 1 5 0 16 0 1 6 0 16 1 1 7 0 52 3 0 2 1 1 0 2 1 8 0 16 1 1 9 0 52 3 0 2 1 10 0 16 1 1 11 0 52 3 0 2 1 12 0 16 1 1 4 0 52 13 0 2 33 32 0 1 15 0 16 0 1 17 0 1 18 0 52 16 0 3 1 19 0 1 20 0 52 16 0 3 52 14 0 2 32 1 0 2 65 7 0 50)
:constants (
"nil?"
"attr-not-found"
"attr-handler"
"get"
"handler"
"attr-title"
"attr-example"
"example"
"attr-description"
"description"
"attr-demo"
"demo"
"attr-wire-id"
"has-key?"
"str"
"ref-wire-"
"replace"
":"
"-"
"*"
"star"))
"build-header-detail"
(code :arity 2
:bytecode (16 1 52 0 0 1 33 10 0 1 1 0 3 65 1 0 32 60 0 1 2 0 16 1 1 4 0 52 3 0 2 1 5 0 16 1 1 6 0 52 3 0 2 1 1 0 2 1 7 0 16 0 1 8 0 16 1 1 9 0 52 3 0 2 1 10 0 16 1 1 11 0 52 3 0 2 65 6 0 50)
:constants (
"nil?"
"header-not-found"
"header-description"
"get"
"description"
"header-demo"
"demo"
"header-title"
"header-example"
"example"
"header-direction"
"direction"))
"build-event-detail"
(code :arity 2
:bytecode (16 1 52 0 0 1 33 10 0 1 1 0 3 65 1 0 32 48 0 1 2 0 16 1 1 4 0 52 3 0 2 1 5 0 16 1 1 6 0 52 3 0 2 1 7 0 16 1 1 8 0 52 3 0 2 1 1 0 2 1 9 0 16 0 65 5 0 50)
:constants (
"nil?"
"event-not-found"
"event-example"
"get"
"example"
"event-demo"
"demo"
"event-description"
"description"
"event-title"))
"build-component-source"
(code :arity 1
:bytecode (16 0 1 1 0 52 0 0 2 17 1 16 0 1 2 0 52 0 0 2 17 2 16 0 1 3 0 52 0 0 2 17 3 16 0 1 4 0 52 0 0 2 17 4 16 0 1 5 0 52 0 0 2 17 5 16 0 1 6 0 52 0 0 2 17 6 16 1 1 8 0 52 7 0 2 33 15 0 1 10 0 16 2 1 11 0 52 9 0 3 32 211 0 16 3 52 12 0 1 33 25 0 16 4 33 13 0 1 14 0 1 15 0 52 13 0 2 32 4 0 52 13 0 0 32 40 0 16 4 33 26 0 1 18 0 16 3 52 17 0 2 1 14 0 1 15 0 52 13 0 2 52 16 0 2 32 9 0 1 18 0 16 3 52 17 0 2 17 7 1 19 0 1 21 0 16 7 52 20 0 2 1 22 0 52 9 0 3 17 8 16 1 1 23 0 52 7 0 2 33 6 0 1 24 0 32 3 0 1 25 0 17 9 16 1 1 26 0 52 7 0 2 6 33 29 0 5 16 6 52 28 0 1 52 27 0 1 6 33 14 0 5 16 6 1 29 0 52 7 0 2 52 27 0 1 33 12 0 1 30 0 16 6 52 9 0 2 32 3 0 1 31 0 17 10 1 19 0 16 9 1 21 0 16 2 1 21 0 16 8 16 10 1 32 0 16 5 1 22 0 52 9 0 10 50)
:constants (
"get"
"type"
"name"
"params"
"has-children"
"body-sx"
"affinity"
"="
"not-found"
"str"
";; component "
" not found"
"empty?"
"list"
"&rest"
"children"
"append"
"cons"
"&key"
"("
"join"
" "
")"
"island"
"defisland"
"defcomp"
"component"
"not"
"nil?"
"auto"
" :affinity "
""
"
"))
"build-bundle-analysis"
(code :arity 6
:bytecode (52 0 0 0 17 6 51 2 0 1 2 1 1 1 6 16 0 52 1 0 2 5 1 3 0 16 3 1 4 0 16 6 1 5 0 16 5 1 6 0 16 4 1 7 0 16 2 65 5 0 50)
:constants (
"list"
"for-each"
(code :arity 1 :upvalue-count 3
:bytecode (16 0 1 1 0 52 0 0 2 17 1 16 1 52 2 0 1 17 2 18 0 1 4 0 52 3 0 2 33 22 0 16 2 18 0 52 7 0 2 1 8 0 52 6 0 2 52 5 0 1 32 3 0 1 4 0 17 3 1 8 0 16 3 52 9 0 2 17 4 1 4 0 17 5 1 4 0 17 6 52 10 0 0 17 7 52 10 0 0 17 8 51 12 0 0 1 1 5 1 6 1 7 1 8 16 1 52 11 0 2 5 20 13 0 18 2 1 14 0 16 5 1 15 0 16 7 52 2 0 1 1 16 0 16 0 1 16 0 52 0 0 2 1 17 0 16 2 1 18 0 16 6 1 19 0 16 8 1 20 0 16 4 1 21 0 16 3 1 22 0 16 0 1 22 0 52 0 0 2 1 23 0 16 0 1 23 0 52 0 0 2 65 10 0 49 2 50)
:constants (
"get"
"needed-names"
"len"
">"
0
"round"
"*"
"/"
100
"-"
"list"
"for-each"
(code :arity 1 :upvalue-count 5
:bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 52 1 0 1 33 174 0 16 1 1 3 0 52 0 0 2 33 14 0 18 1 1 5 0 52 4 0 2 19 1 32 39 0 18 2 1 5 0 52 4 0 2 19 2 5 51 7 0 0 3 16 1 1 8 0 52 0 0 2 6 34 5 0 5 52 9 0 0 52 6 0 2 5 20 10 0 18 4 1 8 0 16 1 1 8 0 52 0 0 2 6 34 5 0 5 52 9 0 0 1 11 0 16 1 1 11 0 52 0 0 2 1 12 0 16 1 1 12 0 52 0 0 2 6 34 5 0 5 52 9 0 0 1 13 0 16 1 1 13 0 52 0 0 2 1 14 0 16 0 1 3 0 16 1 1 3 0 52 0 0 2 1 15 0 16 1 1 15 0 52 0 0 2 65 7 0 49 2 32 1 0 2 50)
:constants (
"get"
"not"
"nil?"
"is-pure"
"+"
1
"for-each"
(code :arity 1 :upvalue-count 1
:bytecode (51 2 0 1 0 18 0 52 1 0 2 52 0 0 1 33 12 0 20 3 0 18 0 16 0 49 2 32 1 0 2 50)
:constants (
"not"
"some"
(code :arity 1 :upvalue-count 1
:bytecode (16 0 18 0 52 0 0 2 50)
:constants (
"="))
"append!"))
"io-refs"
"list"
"append!"
"render-target"
"deps"
"source"
"name"
"affinity"))
"append!"
"pure-in-page"
"io-refs"
"direct"
"needed"
"io-in-page"
"components"
"savings"
"pct"
"path"
"name"))
"total-macros"
"pages"
"io-count"
"pure-count"
"total-components"))
"build-routing-analysis"
(code :arity 1
:bytecode (52 0 0 0 17 1 1 1 0 17 2 1 1 0 17 3 51 3 0 1 3 1 2 1 1 16 0 52 2 0 2 5 1 4 0 16 1 1 5 0 16 2 16 3 52 6 0 2 1 7 0 16 3 1 8 0 16 2 65 4 0 50)
:constants (
"list"
0
"for-each"
(code :arity 1 :upvalue-count 3
:bytecode (16 0 1 1 0 52 0 0 2 17 1 16 0 1 2 0 52 0 0 2 6 34 4 0 5 1 3 0 17 2 2 17 3 1 3 0 17 4 16 1 33 26 0 1 4 0 17 3 5 1 5 0 17 4 5 18 0 1 7 0 52 6 0 2 19 0 32 52 0 16 2 52 8 0 1 33 26 0 1 4 0 17 3 5 1 9 0 17 4 5 18 0 1 7 0 52 6 0 2 19 0 32 17 0 1 10 0 17 3 5 18 1 1 7 0 52 6 0 2 19 1 5 20 11 0 18 2 1 12 0 16 4 1 13 0 16 3 1 14 0 16 2 52 16 0 1 1 17 0 52 15 0 2 33 22 0 16 2 1 20 0 1 17 0 52 19 0 3 1 21 0 52 18 0 2 32 2 0 16 2 1 1 0 16 1 1 22 0 16 0 1 22 0 52 0 0 2 1 23 0 16 0 1 23 0 52 0 0 2 65 6 0 49 2 50)
:constants (
"get"
"has-data"
"content-src"
""
"server"
"Has :data expression — needs server IO"
"+"
1
"empty?"
"No content expression"
"client"
"append!"
"reason"
"mode"
"content-expr"
">"
"len"
80
"str"
"slice"
0
"..."
"path"
"name"))
"pages"
"total-pages"
"+"
"server-count"
"client-count"))
"build-affinity-analysis"
(code :arity 2
:bytecode (1 0 0 16 0 1 1 0 16 1 65 2 0 50)
:constants (
"components"
"page-plans")))))