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

258 lines
9.0 KiB
Plaintext

(sxbc 1 "59a3141f26d62fda"
(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 5 51 27 0 128 26 0 5 51 29 0 128 28 0 5 1 31 0 128 30 0 5 52 33 0 0 128 32 0 5 51 35 0 128 34 0 5 51 37 0 128 36 0 5 51 39 0 128 38 0 5 51 41 0 128 40 0 5 51 43 0 128 42 0 5 51 45 0 128 44 0 50)
:constants (
"make-signal"
(code :arity 1
:bytecode (1 1 0 3 1 2 0 16 0 1 3 0 52 4 0 0 1 5 0 52 4 0 0 52 0 0 8 50)
:constants (
"dict"
"__signal"
"value"
"subscribers"
"list"
"deps"))
"signal?"
(code :arity 1
:bytecode (16 0 52 0 0 1 6 33 10 0 5 16 0 1 2 0 52 1 0 2 50)
:constants (
"dict?"
"has-key?"
"__signal"))
"signal-value"
(code :arity 1
:bytecode (16 0 1 1 0 52 0 0 2 50)
:constants (
"get"
"value"))
"signal-set-value!"
(code :arity 2
:bytecode (16 0 1 1 0 16 1 52 0 0 3 50)
:constants (
"dict-set!"
"value"))
"signal-subscribers"
(code :arity 1
:bytecode (16 0 1 1 0 52 0 0 2 50)
:constants (
"get"
"subscribers"))
"signal-add-sub!"
(code :arity 2
:bytecode (16 0 1 3 0 52 2 0 2 16 1 52 1 0 2 52 0 0 1 33 19 0 20 4 0 16 0 1 3 0 52 2 0 2 16 1 49 2 32 1 0 2 50)
:constants (
"not"
"contains?"
"get"
"subscribers"
"append!"))
"signal-remove-sub!"
(code :arity 2
:bytecode (16 0 1 1 0 52 0 0 2 17 2 20 2 0 16 2 16 1 49 2 50)
:constants (
"get"
"subscribers"
"remove!"))
"signal-deps"
(code :arity 1
:bytecode (16 0 1 1 0 52 0 0 2 50)
:constants (
"get"
"deps"))
"signal-set-deps!"
(code :arity 2
:bytecode (16 0 1 1 0 16 1 52 0 0 3 50)
:constants (
"dict-set!"
"deps"))
"signal"
(code :arity 1
:bytecode (20 0 0 16 0 49 1 50)
:constants (
"make-signal"))
"deref"
(code :arity 1
:bytecode (20 1 0 16 0 48 1 52 0 0 1 33 5 0 16 0 32 87 0 1 3 0 2 52 2 0 2 17 1 16 1 33 63 0 16 1 1 5 0 52 4 0 2 17 2 16 1 1 6 0 52 4 0 2 17 3 16 2 16 0 52 7 0 2 52 0 0 1 33 22 0 20 8 0 16 2 16 0 48 2 5 20 9 0 16 0 16 3 48 2 32 1 0 2 32 1 0 2 5 20 10 0 16 0 49 1 50)
:constants (
"not"
"signal?"
"context"
"sx-reactive"
"get"
"deps"
"notify"
"contains?"
"append!"
"signal-add-sub!"
"signal-value"))
"reset!"
(code :arity 2
:bytecode (20 0 0 16 0 48 1 33 48 0 20 1 0 16 0 48 1 17 2 16 2 16 1 52 3 0 2 52 2 0 1 33 20 0 20 4 0 16 0 16 1 48 2 5 20 5 0 16 0 49 1 32 1 0 2 32 1 0 2 50)
:constants (
"signal?"
"signal-value"
"not"
"identical?"
"signal-set-value!"
"notify-subscribers"))
"swap!"
(code :arity 3
:bytecode (20 0 0 16 0 48 1 33 69 0 20 1 0 16 0 48 1 17 3 20 2 0 16 1 16 3 16 2 52 4 0 2 52 3 0 2 48 1 17 4 16 3 16 4 52 6 0 2 52 5 0 1 33 20 0 20 7 0 16 0 16 4 48 2 5 20 8 0 16 0 49 1 32 1 0 2 32 1 0 2 50)
:constants (
"signal?"
"signal-value"
"trampoline"
"apply"
"cons"
"not"
"identical?"
"signal-set-value!"
"notify-subscribers"))
"computed"
(code :arity 1
:bytecode (20 0 0 2 48 1 17 1 52 1 0 0 17 2 2 17 3 51 2 0 1 4 1 1 1 0 17 4 16 4 48 0 5 20 3 0 51 4 0 1 1 48 1 5 16 1 50)
:constants (
"make-signal"
"list"
(code :upvalue-count 3
:bytecode (51 1 0 0 0 20 2 0 18 1 48 1 52 0 0 2 5 20 3 0 18 1 52 4 0 0 48 2 5 1 6 0 52 4 0 0 1 7 0 18 0 52 5 0 4 17 0 1 9 0 16 0 52 8 0 2 5 18 2 48 0 17 1 1 9 0 52 10 0 1 5 20 3 0 18 1 16 0 1 6 0 52 11 0 2 48 2 5 20 12 0 18 1 48 1 17 2 20 13 0 18 1 16 1 48 2 5 16 2 16 1 52 15 0 2 52 14 0 1 33 10 0 20 16 0 18 1 49 1 32 1 0 2 50)
:constants (
"for-each"
(code :arity 1 :upvalue-count 1
:bytecode (20 0 0 16 0 18 0 49 2 50)
:constants (
"signal-remove-sub!"))
"signal-deps"
"signal-set-deps!"
"list"
"dict"
"deps"
"notify"
"scope-push!"
"sx-reactive"
"scope-pop!"
"get"
"signal-value"
"signal-set-value!"
"not"
"identical?"
"notify-subscribers"))
"register-in-scope"
(code :upvalue-count 1
:bytecode (20 0 0 18 0 49 1 50)
:constants (
"dispose-computed"))))
"effect"
(code :arity 1
:bytecode (52 0 0 0 17 1 4 17 2 2 17 3 51 1 0 1 2 1 3 1 4 1 1 1 0 17 4 16 4 48 0 5 51 2 0 1 2 1 3 1 4 1 1 17 5 20 3 0 16 5 48 1 5 16 5 50)
:constants (
"list"
(code :upvalue-count 5
:bytecode (18 0 52 0 0 1 33 108 0 18 1 33 7 0 18 1 48 0 32 1 0 2 5 51 2 0 0 2 18 3 52 1 0 2 5 52 3 0 0 19 3 5 1 5 0 52 3 0 0 1 6 0 18 2 52 4 0 4 17 0 1 8 0 16 0 52 7 0 2 5 18 4 48 0 17 1 1 8 0 52 9 0 1 5 16 0 1 5 0 52 10 0 2 19 3 5 20 11 0 16 1 48 1 33 7 0 16 1 19 1 32 1 0 2 32 1 0 2 50)
:constants (
"not"
"for-each"
(code :arity 1 :upvalue-count 1
:bytecode (20 0 0 16 0 18 0 49 2 50)
:constants (
"signal-remove-sub!"))
"list"
"dict"
"deps"
"notify"
"scope-push!"
"sx-reactive"
"scope-pop!"
"get"
"callable?"))
(code :upvalue-count 4
:bytecode (3 19 0 5 18 1 33 7 0 18 1 48 0 32 1 0 2 5 51 1 0 0 2 18 3 52 0 0 2 5 52 2 0 0 19 3 50)
:constants (
"for-each"
(code :arity 1 :upvalue-count 1
:bytecode (20 0 0 16 0 18 0 49 2 50)
:constants (
"signal-remove-sub!"))
"list"))
"register-in-scope"))
"*batch-depth*"
0
"*batch-queue*"
"list"
"batch"
(code :arity 1
:bytecode (20 1 0 1 2 0 52 0 0 2 21 1 0 5 16 0 48 0 5 20 1 0 1 2 0 52 3 0 2 21 1 0 5 20 1 0 1 5 0 52 4 0 2 33 51 0 20 6 0 17 1 52 7 0 0 21 6 0 5 52 7 0 0 17 2 52 7 0 0 17 3 51 9 0 1 2 1 3 16 1 52 8 0 2 5 51 10 0 16 3 52 8 0 2 32 1 0 2 50)
:constants (
"+"
"*batch-depth*"
1
"-"
"="
0
"*batch-queue*"
"list"
"for-each"
(code :arity 1 :upvalue-count 2
:bytecode (51 1 0 0 0 0 1 20 2 0 16 0 48 1 52 0 0 2 50)
:constants (
"for-each"
(code :arity 1 :upvalue-count 2
:bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 22 0 20 2 0 18 0 16 0 48 2 5 20 2 0 18 1 16 0 49 2 32 1 0 2 50)
:constants (
"not"
"contains?"
"append!"))
"signal-subscribers"))
(code :arity 1
:bytecode (16 0 49 0 50)
:constants ())))
"notify-subscribers"
(code :arity 1
:bytecode (20 1 0 1 2 0 52 0 0 2 33 33 0 20 5 0 16 0 52 4 0 2 52 3 0 1 33 13 0 20 6 0 20 5 0 16 0 49 2 32 1 0 2 32 7 0 20 7 0 16 0 49 1 50)
:constants (
">"
"*batch-depth*"
0
"not"
"contains?"
"*batch-queue*"
"append!"
"flush-subscribers"))
"flush-subscribers"
(code :arity 1
:bytecode (51 1 0 20 2 0 16 0 48 1 52 0 0 2 50)
:constants (
"for-each"
(code :arity 1
:bytecode (16 0 49 0 50)
:constants ())
"signal-subscribers"))
"dispose-computed"
(code :arity 1
:bytecode (20 0 0 16 0 48 1 33 29 0 51 2 0 20 3 0 16 0 48 1 52 1 0 2 5 20 4 0 16 0 52 5 0 0 49 2 32 1 0 2 50)
:constants (
"signal?"
"for-each"
(code :arity 1
:bytecode (20 0 0 16 0 2 49 2 50)
:constants (
"signal-remove-sub!"))
"signal-deps"
"signal-set-deps!"
"list"))
"with-island-scope"
(code :arity 2
:bytecode (1 1 0 16 0 52 0 0 2 5 16 1 48 0 17 2 1 1 0 52 2 0 1 5 16 2 50)
:constants (
"scope-push!"
"sx-island-scope"
"scope-pop!"))
"register-in-scope"
(code :arity 1
:bytecode (1 1 0 52 0 0 1 17 1 16 1 33 16 0 20 2 0 16 1 16 0 52 3 0 1 49 2 32 1 0 2 50)
:constants (
"scope-peek"
"sx-island-scope"
"cek-call"
"list")))))