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>
111 lines
3.6 KiB
Plaintext
111 lines
3.6 KiB
Plaintext
(sxbc 1 "1e908c466d2b8c22"
|
|
(code
|
|
:bytecode (51 1 0 128 0 0 5 51 3 0 128 2 0 5 52 5 0 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 50)
|
|
:constants (
|
|
"with-marsh-scope"
|
|
(code :arity 2
|
|
:bytecode (52 0 0 0 17 2 20 1 0 51 2 0 1 2 16 1 48 2 5 20 3 0 16 0 1 4 0 16 2 49 3 50)
|
|
:constants (
|
|
"list"
|
|
"with-island-scope"
|
|
(code :arity 1 :upvalue-count 1
|
|
:bytecode (20 0 0 18 0 16 0 49 2 50)
|
|
:constants (
|
|
"append!"))
|
|
"dom-set-data"
|
|
"sx-marsh-disposers"))
|
|
"dispose-marsh-scope"
|
|
(code :arity 1
|
|
:bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 33 24 0 51 3 0 16 1 52 2 0 2 5 20 4 0 16 0 1 1 0 2 49 3 32 1 0 2 50)
|
|
:constants (
|
|
"dom-get-data"
|
|
"sx-marsh-disposers"
|
|
"for-each"
|
|
(code :arity 1
|
|
:bytecode (20 0 0 16 0 2 49 2 50)
|
|
:constants (
|
|
"cek-call"))
|
|
"dom-set-data"))
|
|
"*store-registry*"
|
|
"dict"
|
|
"def-store"
|
|
(code :arity 2
|
|
:bytecode (20 0 0 17 2 16 2 16 0 52 2 0 2 52 1 0 1 33 22 0 16 2 16 0 20 4 0 16 1 2 48 2 52 3 0 3 21 0 0 32 1 0 2 5 20 0 0 16 0 52 5 0 2 50)
|
|
:constants (
|
|
"*store-registry*"
|
|
"not"
|
|
"has-key?"
|
|
"assoc"
|
|
"cek-call"
|
|
"get"))
|
|
"use-store"
|
|
(code :arity 1
|
|
:bytecode (20 1 0 16 0 52 0 0 2 33 12 0 20 1 0 16 0 52 2 0 2 32 16 0 1 5 0 16 0 1 6 0 52 4 0 3 52 3 0 1 50)
|
|
:constants (
|
|
"has-key?"
|
|
"*store-registry*"
|
|
"get"
|
|
"error"
|
|
"str"
|
|
"Store not found: "
|
|
". Call (def-store ...) before (use-store ...)."))
|
|
"clear-stores"
|
|
(code
|
|
:bytecode (52 0 0 0 21 1 0 50)
|
|
:constants (
|
|
"dict"
|
|
"*store-registry*"))
|
|
"emit-event"
|
|
(code :arity 3
|
|
:bytecode (20 0 0 16 0 16 1 16 2 49 3 50)
|
|
:constants (
|
|
"dom-dispatch"))
|
|
"on-event"
|
|
(code :arity 3
|
|
:bytecode (20 0 0 16 0 16 1 16 2 49 3 50)
|
|
:constants (
|
|
"dom-on"))
|
|
"bridge-event"
|
|
(code :arity 4
|
|
:bytecode (20 0 0 51 1 0 1 0 1 1 1 3 1 2 49 1 50)
|
|
:constants (
|
|
"effect"
|
|
(code :upvalue-count 4
|
|
:bytecode (20 0 0 18 0 18 1 51 1 0 0 2 0 3 48 3 17 0 16 0 50)
|
|
:constants (
|
|
"dom-on"
|
|
(code :arity 1 :upvalue-count 2
|
|
:bytecode (20 0 0 16 0 48 1 17 1 18 0 33 16 0 20 1 0 18 0 16 1 52 2 0 1 48 2 32 2 0 16 1 17 2 20 3 0 18 1 16 2 49 2 50)
|
|
:constants (
|
|
"event-detail"
|
|
"cek-call"
|
|
"list"
|
|
"reset!"))))))
|
|
"resource"
|
|
(code :arity 1
|
|
:bytecode (20 0 0 1 2 0 3 1 3 0 2 1 4 0 2 52 1 0 6 48 1 17 1 20 5 0 20 6 0 16 0 2 48 2 51 7 0 1 1 51 8 0 1 1 48 3 5 16 1 50)
|
|
:constants (
|
|
"signal"
|
|
"dict"
|
|
"loading"
|
|
"data"
|
|
"error"
|
|
"promise-then"
|
|
"cek-call"
|
|
(code :arity 1 :upvalue-count 1
|
|
:bytecode (20 0 0 18 0 1 2 0 4 1 3 0 16 0 1 4 0 2 52 1 0 6 49 2 50)
|
|
:constants (
|
|
"reset!"
|
|
"dict"
|
|
"loading"
|
|
"data"
|
|
"error"))
|
|
(code :arity 1 :upvalue-count 1
|
|
:bytecode (20 0 0 18 0 1 2 0 4 1 3 0 2 1 4 0 16 0 52 1 0 6 49 2 50)
|
|
:constants (
|
|
"reset!"
|
|
"dict"
|
|
"loading"
|
|
"data"
|
|
"error")))))))
|