Files
rose-ash/shared/static/wasm/sx/hypersx.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

310 lines
13 KiB
Plaintext

(sxbc 1 "352dd0823915cc55"
(code
:bytecode (51 1 0 128 0 0 5 51 3 0 128 2 0 5 51 5 0 128 4 0 5 51 7 0 128 6 0 5 51 9 0 128 8 0 5 51 11 0 128 10 0 5 51 13 0 128 12 0 5 51 15 0 128 14 0 5 51 17 0 128 16 0 5 51 19 0 128 18 0 5 51 21 0 128 20 0 5 51 23 0 128 22 0 5 51 25 0 128 24 0 50)
:constants (
"hsx-indent"
(code :arity 1
:bytecode (1 0 0 17 1 51 2 0 1 1 1 4 0 16 0 52 3 0 2 52 1 0 2 5 16 1 50)
:constants (
""
"for-each"
(code :arity 1 :upvalue-count 1
:bytecode (18 0 1 1 0 52 0 0 2 19 0 50)
:constants (
"str"
" "))
"range"
0))
"hsx-sym-name"
(code :arity 1
:bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 10 0 20 3 0 16 0 49 1 32 1 0 2 50)
:constants (
"="
"type-of"
"symbol"
"symbol-name"))
"hsx-kw-name"
(code :arity 1
:bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 10 0 20 3 0 16 0 49 1 32 1 0 2 50)
:constants (
"="
"type-of"
"keyword"
"keyword-name"))
"hsx-is-element?"
(code :arity 1
:bytecode (16 0 6 33 26 0 5 16 0 1 2 0 52 1 0 2 52 0 0 1 6 33 8 0 5 20 3 0 16 0 49 1 50)
:constants (
"not"
"starts-with?"
"~"
"is-html-tag?"))
"hsx-is-component?"
(code :arity 1
:bytecode (16 0 6 33 10 0 5 16 0 1 1 0 52 0 0 2 50)
:constants (
"starts-with?"
"~"))
"hsx-extract-css"
(code :arity 1
:bytecode (2 17 1 2 17 2 52 0 0 0 17 3 1 1 0 17 4 16 0 52 2 0 1 17 5 2 17 6 51 3 0 1 4 1 5 1 0 1 1 1 6 1 2 1 3 17 6 16 6 48 0 5 1 5 0 16 1 1 6 0 16 2 1 7 0 16 3 1 8 0 16 4 16 5 52 9 0 2 33 11 0 16 0 16 4 52 10 0 2 32 4 0 52 0 0 0 52 4 0 8 50)
:constants (
"list"
0
"len"
(code :upvalue-count 7
:bytecode (18 0 18 1 52 0 0 2 33 180 0 20 1 0 18 2 18 0 52 2 0 2 48 1 17 0 16 0 1 4 0 52 3 0 2 33 37 0 18 2 18 0 1 6 0 52 5 0 2 52 2 0 2 19 3 5 18 0 1 7 0 52 5 0 2 19 0 5 18 4 49 0 32 113 0 16 0 1 8 0 52 3 0 2 33 37 0 18 2 18 0 1 6 0 52 5 0 2 52 2 0 2 19 5 5 18 0 1 7 0 52 5 0 2 19 0 5 18 4 49 0 32 64 0 16 0 33 58 0 20 9 0 18 6 18 2 18 0 52 2 0 2 48 2 5 20 9 0 18 6 18 2 18 0 1 6 0 52 5 0 2 52 2 0 2 48 2 5 18 0 1 7 0 52 5 0 2 19 0 5 18 4 49 0 32 1 0 2 32 1 0 2 50)
:constants (
"<"
"hsx-kw-name"
"nth"
"="
"class"
"+"
1
2
"id"
"append!"))
"dict"
"classes"
"id"
"attrs"
"children"
"<"
"slice"))
"hsx-tag-str"
(code :arity 2
:bytecode (16 0 17 2 16 1 1 1 0 52 0 0 2 17 3 16 1 1 2 0 52 0 0 2 17 4 16 3 6 33 7 0 5 16 3 52 3 0 1 33 21 0 51 5 0 1 2 16 3 1 7 0 52 6 0 2 52 4 0 2 32 1 0 2 5 16 4 33 16 0 16 2 1 9 0 16 4 52 8 0 3 17 2 32 1 0 2 5 16 2 50)
:constants (
"get"
"classes"
"id"
"string?"
"for-each"
(code :arity 1 :upvalue-count 1
:bytecode (18 0 1 1 0 16 0 52 0 0 3 19 0 50)
:constants (
"str"
"."))
"split"
" "
"str"
"#"))
"hsx-atom"
(code :arity 1
:bytecode (16 0 52 0 0 1 33 6 0 1 1 0 32 151 0 16 0 52 2 0 1 33 15 0 1 4 0 16 0 1 4 0 52 3 0 3 32 127 0 16 0 52 5 0 1 33 9 0 16 0 52 3 0 1 32 109 0 16 0 52 7 0 1 1 8 0 52 6 0 2 33 17 0 16 0 33 6 0 1 9 0 32 3 0 1 10 0 32 76 0 16 0 52 7 0 1 1 11 0 52 6 0 2 33 20 0 1 12 0 20 13 0 16 0 48 1 1 14 0 52 3 0 3 32 40 0 16 0 52 7 0 1 1 15 0 52 6 0 2 33 17 0 1 16 0 20 17 0 16 0 48 1 52 3 0 2 32 7 0 20 18 0 16 0 49 1 50)
:constants (
"nil?"
"nil"
"string?"
"str"
"\""
"number?"
"="
"type-of"
"boolean"
"true"
"false"
"symbol"
"{"
"symbol-name"
"}"
"keyword"
":"
"keyword-name"
"sx-serialize"))
"hsx-inline"
(code :arity 1
:bytecode (16 0 52 1 0 1 52 0 0 1 33 10 0 20 2 0 16 0 49 1 32 84 1 16 0 52 3 0 1 33 6 0 1 4 0 32 69 1 20 5 0 16 0 52 6 0 1 48 1 17 1 16 1 1 8 0 52 7 0 2 33 24 0 1 10 0 20 2 0 16 0 1 12 0 52 11 0 2 48 1 52 9 0 2 32 20 1 16 1 1 13 0 52 7 0 2 33 49 0 1 14 0 16 0 52 16 0 1 1 12 0 52 15 0 2 33 17 0 20 17 0 16 0 1 12 0 52 11 0 2 48 1 32 3 0 1 18 0 1 19 0 52 9 0 3 32 215 0 16 1 1 20 0 52 7 0 2 33 38 0 20 2 0 16 0 1 12 0 52 11 0 2 48 1 1 21 0 20 17 0 16 0 1 22 0 52 11 0 2 48 1 52 9 0 3 32 165 0 16 1 1 23 0 52 7 0 2 33 38 0 20 2 0 16 0 1 12 0 52 11 0 2 48 1 1 24 0 20 17 0 16 0 1 22 0 52 11 0 2 48 1 52 9 0 3 32 115 0 16 1 1 9 0 52 7 0 2 33 33 0 1 25 0 1 18 0 51 28 0 16 0 52 29 0 1 52 27 0 2 52 26 0 2 1 25 0 52 9 0 3 32 70 0 1 30 0 20 2 0 16 0 52 6 0 1 48 1 16 0 52 16 0 1 1 12 0 52 15 0 2 33 30 0 1 31 0 1 31 0 20 17 0 16 0 52 29 0 1 52 27 0 2 52 26 0 2 52 9 0 2 32 3 0 1 18 0 1 19 0 52 9 0 4 50)
:constants (
"not"
"list?"
"sx-serialize"
"empty?"
"()"
"hsx-sym-name"
"first"
"="
"deref"
"str"
"@"
"nth"
1
"signal"
"signal("
">"
"len"
"hsx-inline"
""
")"
"reset!"
" := "
2
"swap!"
" <- "
"\""
"join"
"map"
(code :arity 1
:bytecode (16 0 52 0 0 1 33 5 0 16 0 32 17 0 1 2 0 20 3 0 16 0 48 1 1 4 0 52 1 0 3 50)
:constants (
"string?"
"str"
"{"
"hsx-inline"
"}"))
"rest"
"("
" "))
"hsx-attrs-str"
(code :arity 1
:bytecode (16 0 52 0 0 1 33 6 0 1 1 0 32 48 0 52 2 0 0 17 1 1 3 0 17 2 2 17 3 51 4 0 1 2 1 0 1 1 1 3 17 3 16 3 48 0 5 1 6 0 1 6 0 16 1 52 7 0 2 52 5 0 2 50)
:constants (
"empty?"
""
"list"
0
(code :upvalue-count 4
:bytecode (18 0 18 1 52 1 0 1 52 0 0 2 33 70 0 20 2 0 18 2 1 4 0 20 5 0 18 1 18 0 52 6 0 2 48 1 1 7 0 20 8 0 18 1 18 0 1 10 0 52 9 0 2 52 6 0 2 48 1 52 3 0 4 48 2 5 18 0 1 11 0 52 9 0 2 19 0 5 18 3 49 0 32 1 0 2 50)
:constants (
"<"
"len"
"append!"
"str"
":"
"keyword-name"
"nth"
" "
"hsx-atom"
"+"
1
2))
"str"
" "
"join"))
"hsx-children"
(code :arity 3
:bytecode (16 1 52 0 0 1 33 5 0 16 0 32 85 0 16 1 52 2 0 1 1 3 0 52 1 0 2 6 33 15 0 5 16 1 52 6 0 1 52 5 0 1 52 4 0 1 33 23 0 16 0 1 8 0 20 9 0 16 1 52 6 0 1 48 1 52 7 0 3 32 27 0 16 0 1 10 0 1 10 0 51 13 0 1 2 16 1 52 12 0 2 52 11 0 2 52 7 0 3 50)
:constants (
"empty?"
"="
"len"
1
"not"
"list?"
"first"
"str"
" "
"hsx-atom"
"
"
"join"
"map"
(code :arity 1 :upvalue-count 1
:bytecode (20 0 0 16 0 18 0 1 2 0 52 1 0 2 49 2 50)
:constants (
"sx->hypersx-node"
"+"
1))))
"sx->hypersx-node"
(code :arity 2
:bytecode (20 0 0 16 1 48 1 17 2 16 0 52 1 0 1 33 12 0 16 2 1 3 0 52 2 0 2 32 201 4 16 0 52 5 0 1 52 4 0 1 33 16 0 16 2 20 6 0 16 0 48 1 52 2 0 2 32 172 4 16 0 52 7 0 1 33 12 0 16 2 1 8 0 52 2 0 2 32 151 4 20 9 0 16 0 52 10 0 1 48 1 17 3 16 3 1 2 0 52 11 0 2 33 16 0 16 2 20 12 0 16 0 48 1 52 2 0 2 32 110 4 16 3 1 13 0 52 11 0 2 33 16 0 16 2 20 12 0 16 0 48 1 52 2 0 2 32 82 4 16 3 1 14 0 52 11 0 2 33 16 0 16 2 20 12 0 16 0 48 1 52 2 0 2 32 54 4 16 3 1 15 0 52 11 0 2 33 16 0 16 2 20 12 0 16 0 48 1 52 2 0 2 32 26 4 16 3 1 16 0 52 11 0 2 33 16 0 16 2 20 12 0 16 0 48 1 52 2 0 2 32 254 3 16 3 1 17 0 52 11 0 2 6 34 10 0 5 16 3 1 18 0 52 11 0 2 33 68 0 16 2 16 3 1 19 0 20 20 0 16 0 1 22 0 52 21 0 2 48 1 1 19 0 20 20 0 16 0 1 23 0 52 21 0 2 48 1 1 24 0 20 25 0 16 0 52 26 0 1 16 1 1 22 0 52 27 0 2 48 2 52 2 0 8 32 160 3 16 3 1 28 0 52 11 0 2 33 54 0 16 2 1 29 0 20 12 0 16 0 1 22 0 52 21 0 2 48 1 1 24 0 1 24 0 51 32 0 1 1 16 0 1 23 0 52 33 0 2 52 31 0 2 52 30 0 2 52 2 0 5 32 94 3 16 3 1 34 0 52 11 0 2 33 223 0 16 0 1 22 0 52 21 0 2 17 4 16 0 1 23 0 52 21 0 2 17 5 16 0 52 36 0 1 1 37 0 52 35 0 2 33 12 0 16 0 1 37 0 52 21 0 2 32 1 0 2 17 6 16 5 52 5 0 1 52 4 0 1 6 33 22 0 5 16 6 52 1 0 1 6 34 11 0 5 16 6 52 5 0 1 52 4 0 1 33 54 0 16 2 1 38 0 20 12 0 16 4 48 1 1 19 0 20 6 0 16 5 48 1 16 6 33 17 0 1 19 0 20 6 0 16 6 48 1 52 2 0 2 32 3 0 1 39 0 52 2 0 6 32 74 0 16 2 1 38 0 20 12 0 16 4 48 1 1 24 0 20 25 0 16 5 16 1 1 22 0 52 27 0 2 48 2 16 6 33 31 0 1 24 0 16 2 1 40 0 20 25 0 16 6 16 1 1 22 0 52 27 0 2 48 2 52 2 0 4 32 3 0 1 39 0 52 2 0 6 32 115 2 16 3 1 41 0 52 11 0 2 6 34 24 0 5 16 3 1 42 0 52 11 0 2 6 34 10 0 5 16 3 1 43 0 52 11 0 2 33 121 0 16 0 1 22 0 52 21 0 2 17 4 16 0 1 23 0 52 33 0 2 17 5 16 2 16 3 1 19 0 1 44 0 51 45 0 16 4 52 5 0 1 6 33 26 0 5 16 4 52 7 0 1 52 4 0 1 6 33 11 0 5 16 4 52 10 0 1 52 5 0 1 33 5 0 16 4 32 6 0 16 4 52 46 0 1 52 31 0 2 52 30 0 2 1 24 0 1 24 0 51 32 0 1 1 16 5 52 31 0 2 52 30 0 2 52 2 0 6 32 210 1 16 3 1 31 0 52 11 0 2 6 33 62 0 5 16 0 52 36 0 1 1 37 0 52 11 0 2 6 33 44 0 5 16 0 1 22 0 52 21 0 2 52 5 0 1 6 33 26 0 5 20 9 0 16 0 1 22 0 52 21 0 2 52 10 0 1 48 1 1 47 0 52 11 0 2 33 81 0 16 0 1 22 0 52 21 0 2 17 4 16 0 1 23 0 52 21 0 2 17 5 16 2 1 48 0 20 12 0 16 5 48 1 1 49 0 20 20 0 16 4 1 22 0 52 21 0 2 48 1 1 24 0 20 25 0 16 4 52 26 0 1 16 1 1 22 0 52 27 0 2 48 2 52 2 0 7 32 51 1 16 3 1 50 0 52 11 0 2 6 33 62 0 5 16 0 52 36 0 1 1 37 0 52 11 0 2 6 33 44 0 5 16 0 1 22 0 52 21 0 2 52 5 0 1 6 33 26 0 5 20 9 0 16 0 1 22 0 52 21 0 2 52 10 0 1 48 1 1 47 0 52 11 0 2 33 81 0 16 0 1 22 0 52 21 0 2 17 4 16 0 1 23 0 52 21 0 2 17 5 16 2 1 51 0 20 20 0 16 4 1 22 0 52 21 0 2 48 1 1 52 0 20 12 0 16 5 48 1 1 24 0 20 25 0 16 4 52 26 0 1 16 1 1 22 0 52 27 0 2 48 2 52 2 0 7 32 148 0 20 53 0 16 3 48 1 33 61 0 20 54 0 16 0 52 55 0 1 48 1 17 4 20 56 0 16 2 20 57 0 16 3 16 4 48 2 20 58 0 16 4 1 60 0 52 59 0 2 48 1 52 2 0 3 16 4 1 61 0 52 59 0 2 16 1 49 3 32 77 0 20 62 0 16 3 48 1 33 54 0 20 54 0 16 0 52 55 0 1 48 1 17 4 20 56 0 16 2 16 3 20 58 0 16 4 1 60 0 52 59 0 2 48 1 52 2 0 3 16 4 1 61 0 52 59 0 2 16 1 49 3 32 13 0 16 2 20 20 0 16 0 48 1 52 2 0 2 50)
:constants (
"hsx-indent"
"nil?"
"str"
"nil"
"not"
"list?"
"hsx-atom"
"empty?"
"()"
"hsx-sym-name"
"first"
"="
"hsx-inline"
"deref"
"reset!"
"swap!"
"signal"
"defcomp"
"defisland"
" "
"sx-serialize"
"nth"
1
2
"
"
"sx->hypersx-node"
"last"
"+"
"when"
"when "
"join"
"map"
(code :arity 1 :upvalue-count 1
:bytecode (20 0 0 16 0 18 0 1 2 0 52 1 0 2 49 2 50)
:constants (
"sx->hypersx-node"
"+"
1))
"slice"
"if"
">"
"len"
3
"if "
""
"else
"
"let"
"letrec"
"let*"
", "
(code :arity 1
:bytecode (16 0 52 0 0 1 6 33 14 0 5 16 0 52 2 0 1 1 3 0 52 1 0 2 33 35 0 20 5 0 16 0 52 6 0 1 48 1 1 7 0 20 8 0 16 0 1 10 0 52 9 0 2 48 1 52 4 0 3 32 7 0 20 5 0 16 0 49 1 50)
:constants (
"list?"
">="
"len"
2
"str"
"sx-serialize"
"first"
" = "
"hsx-inline"
"nth"
1))
"list"
"fn"
"map "
" -> "
"for-each"
"for "
" in "
"hsx-is-element?"
"hsx-extract-css"
"rest"
"hsx-children"
"hsx-tag-str"
"hsx-attrs-str"
"get"
"attrs"
"children"
"hsx-is-component?"))
"sx->hypersx"
(code :arity 1
:bytecode (1 1 0 51 3 0 16 0 52 2 0 2 52 0 0 2 50)
:constants (
"join"
"
"
"map"
(code :arity 1
:bytecode (20 0 0 16 0 1 1 0 49 2 50)
:constants (
"sx->hypersx-node"
0)))))))