Lazy module loading (Step 5 piece 6 completion): - Add define-library wrappers + import declarations to 13 source .sx files - compile-modules.js generates module-manifest.json with dependency graph - compile-modules.js strips define-library/import before bytecode compilation (VM doesn't handle these as special forms) - sx-platform.js replaces hardcoded 24-file loadWebStack() with manifest-driven recursive loader — only downloads modules the page needs - Result: 12 modules loaded (was 24), zero errors, zero warnings - Fallback to full load if manifest missing VM transpilation prep (Step 6b): - Refactor lib/vm.sx: 20 accessor functions replace raw dict access - Factor out collect-n-from-stack, collect-n-pairs, pad-n-nils helpers - bootstrap_vm.py: transpiles 9 VM logic functions to OCaml - sx_vm_ref.ml: proof that vm.sx transpiles (preamble has stubs) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 lines
9.7 KiB
Plaintext
4 lines
9.7 KiB
Plaintext
(sxbc 1 "d44c2ab4fd3c6651"
|
|
(code
|
|
:constants ("mock-element" {:upvalue-count 0 :arity 3 :constants ("children" "list" "listeners" "event-log" "tag" "text" "" "attrs" "merge" "class" "id") :bytecode (1 0 0 52 1 0 0 1 2 0 65 0 0 1 3 0 52 1 0 0 1 4 0 16 0 1 5 0 1 6 0 1 7 0 65 0 0 16 1 33 11 0 1 9 0 16 1 65 1 0 32 3 0 65 0 0 16 2 33 11 0 1 10 0 16 2 65 1 0 32 3 0 65 0 0 52 8 0 3 65 6 0 50)} "mock-set-text!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "text") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "mock-append-child!" {:upvalue-count 0 :arity 2 :constants ("append!" "get" "children") :bytecode (16 0 1 2 0 52 1 0 2 16 1 52 0 0 2 50)} "mock-set-attr!" {:upvalue-count 0 :arity 3 :constants ("dict-set!" "get" "attrs") :bytecode (16 0 1 2 0 52 1 0 2 16 1 16 2 52 0 0 3 50)} "mock-get-attr" {:upvalue-count 0 :arity 2 :constants ("get" "attrs") :bytecode (16 0 1 1 0 52 0 0 2 16 1 52 0 0 2 50)} "mock-add-listener!" {:upvalue-count 0 :arity 3 :constants ("get" "listeners" "not" "has-key?" "dict-set!" "list" "append!") :bytecode (16 0 1 1 0 52 0 0 2 17 3 16 3 16 1 52 3 0 2 52 2 0 1 33 15 0 16 3 16 1 52 5 0 0 52 4 0 3 32 1 0 2 5 16 3 16 1 52 0 0 2 16 2 52 6 0 2 50)} "simulate-click" {:upvalue-count 0 :arity 1 :constants ("get" "listeners" "click" "for-each" {:upvalue-count 1 :arity 1 :constants ("cek-call" "list" "target" "type" "click") :bytecode (16 0 1 2 0 18 0 1 3 0 1 4 0 65 2 0 52 1 0 1 52 0 0 2 50)} "append!" "event-log" "type") :bytecode (16 0 1 1 0 52 0 0 2 1 2 0 52 0 0 2 17 1 16 1 33 14 0 51 4 0 1 0 16 1 52 3 0 2 32 1 0 2 5 16 0 1 6 0 52 0 0 2 1 7 0 1 2 0 65 1 0 52 5 0 2 50)} "simulate-input" {:upvalue-count 0 :arity 2 :constants ("mock-set-attr!" "value" "get" "listeners" "input" "for-each" {:upvalue-count 1 :arity 1 :constants ("cek-call" "list" "target" "type" "input") :bytecode (16 0 1 2 0 18 0 1 3 0 1 4 0 65 2 0 52 1 0 1 52 0 0 2 50)} "append!" "event-log" "type") :bytecode (20 0 0 16 0 1 1 0 16 1 48 3 5 16 0 1 3 0 52 2 0 2 1 4 0 52 2 0 2 17 2 16 2 33 14 0 51 6 0 1 0 16 2 52 5 0 2 32 1 0 2 5 16 0 1 8 0 52 2 0 2 1 1 0 16 1 1 9 0 1 4 0 65 2 0 52 7 0 2 50)} "simulate-event" {:upvalue-count 0 :arity 3 :constants ("get" "listeners" "for-each" {:upvalue-count 3 :arity 1 :constants ("cek-call" "list" "target" "detail" "type") :bytecode (16 0 1 2 0 18 0 1 3 0 18 1 1 4 0 18 2 65 3 0 52 1 0 1 52 0 0 2 50)} "append!" "event-log" "detail" "type") :bytecode (16 0 1 1 0 52 0 0 2 16 1 52 0 0 2 17 3 16 3 33 18 0 51 3 0 1 0 1 2 1 1 16 3 52 2 0 2 32 1 0 2 5 16 0 1 5 0 52 0 0 2 1 6 0 16 2 1 7 0 16 1 65 2 0 52 4 0 2 50)} "assert-text" {:upvalue-count 0 :arity 2 :constants ("get" "text" "assert=" "str" "Expected text \"" "\", got \"" "\"") :bytecode (16 0 1 1 0 52 0 0 2 17 2 20 2 0 16 2 16 1 1 4 0 16 1 1 5 0 16 2 1 6 0 52 3 0 5 49 3 50)} "assert-attr" {:upvalue-count 0 :arity 3 :constants ("mock-get-attr" "assert=" "str" "Expected attr " "=\"" "\", got \"" "\"") :bytecode (20 0 0 16 0 16 1 48 2 17 3 20 1 0 16 3 16 2 1 3 0 16 1 1 4 0 16 2 1 5 0 16 3 1 6 0 52 2 0 7 49 3 50)} "assert-class" {:upvalue-count 0 :arity 2 :constants ("mock-get-attr" "class" "" "assert" "contains?" "split" " " "str" "Expected class \"" "\" in \"" "\"") :bytecode (20 0 0 16 0 1 1 0 48 2 6 34 4 0 5 1 2 0 17 2 20 3 0 16 2 1 6 0 52 5 0 2 16 1 52 4 0 2 1 8 0 16 1 1 9 0 16 2 1 10 0 52 7 0 5 49 2 50)} "assert-no-class" {:upvalue-count 0 :arity 2 :constants ("mock-get-attr" "class" "" "assert" "not" "contains?" "split" " " "str" "Expected no class \"" "\" but found in \"" "\"") :bytecode (20 0 0 16 0 1 1 0 48 2 6 34 4 0 5 1 2 0 17 2 20 3 0 16 2 1 7 0 52 6 0 2 16 1 52 5 0 2 52 4 0 1 1 9 0 16 1 1 10 0 16 2 1 11 0 52 8 0 5 49 2 50)} "assert-child-count" {:upvalue-count 0 :arity 2 :constants ("len" "get" "children" "assert=" "str" "Expected " " children, got ") :bytecode (16 0 1 2 0 52 1 0 2 52 0 0 1 17 2 20 3 0 16 2 16 1 1 5 0 16 1 1 6 0 16 2 52 4 0 4 49 3 50)} "assert-event-fired" {:upvalue-count 0 :arity 2 :constants ("assert" "some" {:upvalue-count 1 :arity 1 :constants ("=" "get" "type") :bytecode (16 0 1 2 0 52 1 0 2 18 0 52 0 0 2 50)} "get" "event-log" "str" "Expected event \"" "\" to have been fired") :bytecode (20 0 0 51 2 0 1 1 16 0 1 4 0 52 3 0 2 52 1 0 2 1 6 0 16 1 1 7 0 52 5 0 3 49 2 50)} "assert-no-event" {:upvalue-count 0 :arity 2 :constants ("assert" "not" "some" {:upvalue-count 1 :arity 1 :constants ("=" "get" "type") :bytecode (16 0 1 2 0 52 1 0 2 18 0 52 0 0 2 50)} "get" "event-log" "str" "Expected event \"" "\" to NOT have been fired") :bytecode (20 0 0 51 3 0 1 1 16 0 1 5 0 52 4 0 2 52 2 0 2 52 1 0 1 1 7 0 16 1 1 8 0 52 6 0 3 49 2 50)} "event-fire-count" {:upvalue-count 0 :arity 2 :constants ("len" "filter" {:upvalue-count 1 :arity 1 :constants ("=" "get" "type") :bytecode (16 0 1 2 0 52 1 0 2 18 0 52 0 0 2 50)} "get" "event-log") :bytecode (51 2 0 1 1 16 0 1 4 0 52 3 0 2 52 1 0 2 52 0 0 1 50)} "make-web-harness" {:upvalue-count 0 :arity 1 :constants ("make-harness" "platform" "harness-set!" "dom" "elements" "root" "mock-element" "div" "id") :bytecode (20 0 0 1 1 0 16 0 48 2 17 1 20 2 0 16 1 1 3 0 1 4 0 65 0 0 1 5 0 20 6 0 1 7 0 1 8 0 1 5 0 48 3 65 2 0 48 3 5 16 1 50)} "is-renderable?" {:upvalue-count 0 :arity 1 :constants ("nil?" "string?" "number?" "boolean?" "dict?" "not" "list?" "empty?" "first" "=" "type-of" "symbol") :bytecode (16 0 52 0 0 1 33 4 0 3 32 118 0 16 0 52 1 0 1 33 4 0 3 32 105 0 16 0 52 2 0 1 33 4 0 3 32 92 0 16 0 52 3 0 1 33 4 0 3 32 79 0 16 0 52 4 0 1 33 4 0 4 32 66 0 16 0 52 6 0 1 52 5 0 1 33 4 0 4 32 49 0 16 0 52 7 0 1 33 4 0 3 32 36 0 16 0 52 8 0 1 17 1 16 1 52 10 0 1 1 11 0 52 9 0 2 6 33 11 0 5 16 1 52 4 0 1 52 5 0 1 50)} "is-render-leak?" {:upvalue-count 0 :arity 1 :constants ("not" "nil?" "is-renderable?") :bytecode (16 0 52 1 0 1 52 0 0 1 6 33 12 0 5 20 2 0 16 0 48 1 52 0 0 1 50)} "assert-renderable" {:upvalue-count 0 :arity 2 :constants ("assert" "is-renderable?" "str" "Render leak in " ": " "type-of" "dict?" " — dict would appear as {:key val} text in output" "list?" "not" "empty?" "first" " — list of dicts would appear as raw data in output" " — non-renderable value would appear as text") :bytecode (20 0 0 20 1 0 16 0 48 1 1 3 0 16 1 1 4 0 16 0 52 5 0 1 16 0 52 6 0 1 33 6 0 1 7 0 32 48 0 16 0 52 8 0 1 6 33 26 0 5 16 0 52 10 0 1 52 9 0 1 6 33 11 0 5 16 0 52 11 0 1 52 6 0 1 33 6 0 1 12 0 32 3 0 1 13 0 52 2 0 5 49 2 50)} "render-body-audit" {:upvalue-count 0 :arity 1 :constants ("list" "for-each" {:upvalue-count 1 :arity 1 :constants ("is-render-leak?" "append!" "leak-kind" "dict?" "dict" "list?" "not" "empty?" "first" "list-of-dicts" "other" "value-type" "type-of") :bytecode (20 0 0 16 0 48 1 33 87 0 18 0 1 2 0 16 0 52 3 0 1 33 6 0 1 4 0 32 48 0 16 0 52 5 0 1 6 33 26 0 5 16 0 52 7 0 1 52 6 0 1 6 33 11 0 5 16 0 52 8 0 1 52 3 0 1 33 6 0 1 9 0 32 3 0 1 10 0 1 11 0 16 0 52 12 0 1 65 2 0 52 1 0 2 32 1 0 2 50)}) :bytecode (52 0 0 0 17 1 51 2 0 1 1 16 0 52 1 0 2 5 16 1 50)} "assert-render-body-clean" {:upvalue-count 0 :arity 2 :constants ("render-body-audit" "assert" "empty?" "str" "Render body has " "len" " leak(s) in " ". " "render-to-html/render-to-dom render ALL body expressions — " "put side effects in let bindings, not body expressions.") :bytecode (20 0 0 16 0 48 1 17 2 20 1 0 16 2 52 2 0 1 1 4 0 16 2 52 5 0 1 1 6 0 16 1 1 7 0 1 8 0 1 9 0 52 3 0 7 49 2 50)} "mock-render" {:upvalue-count 0 :arity 1 :constants ("nil?" "string?" "mock-element" "TEXT" "mock-set-text!" "number?" "str" "not" "list?" "empty?" "first" "=" "type-of" "symbol" "symbol-name" {:upvalue-count 2 :arity 1 :constants ("not" "empty?" "first" "=" "type-of" "keyword" "rest" "mock-set-attr!" "keyword-name" "nth" 1 "mock-render" "mock-append-child!") :bytecode (16 0 52 1 0 1 52 0 0 1 33 126 0 16 0 52 2 0 1 17 1 16 1 52 4 0 1 1 5 0 52 3 0 2 33 61 0 16 0 52 6 0 1 52 1 0 1 52 0 0 1 33 40 0 20 7 0 18 0 16 1 52 8 0 1 16 0 1 10 0 52 9 0 2 48 3 5 18 1 16 0 52 6 0 1 52 6 0 1 49 1 32 1 0 2 32 38 0 20 11 0 16 1 48 1 17 2 16 2 33 12 0 20 12 0 18 0 16 2 48 2 32 1 0 2 5 18 1 16 0 52 6 0 1 49 1 32 1 0 2 50)} "rest") :bytecode (16 0 52 0 0 1 33 4 0 2 32 172 0 16 0 52 1 0 1 33 25 0 20 2 0 1 3 0 48 1 17 1 20 4 0 16 1 16 0 48 2 5 16 1 32 138 0 16 0 52 5 0 1 33 29 0 20 2 0 1 3 0 48 1 17 1 20 4 0 16 1 16 0 52 6 0 1 48 2 5 16 1 32 100 0 16 0 52 8 0 1 52 7 0 1 33 4 0 2 32 83 0 16 0 52 9 0 1 33 4 0 2 32 70 0 16 0 52 10 0 1 17 1 16 1 52 12 0 1 1 13 0 52 11 0 2 52 7 0 1 33 4 0 2 32 38 0 20 2 0 16 1 52 14 0 1 48 1 17 2 2 17 3 51 15 0 1 2 1 3 17 3 16 3 16 0 52 16 0 1 48 1 5 16 2 50)} "mock-render-fragment" {:upvalue-count 0 :arity 1 :constants ("filter" {:upvalue-count 0 :arity 1 :constants ("not" "nil?") :bytecode (16 0 52 1 0 1 52 0 0 1 50)} "map" "mock-render") :bytecode (51 1 0 20 3 0 16 0 52 2 0 2 52 0 0 2 50)} "assert-single-render-root" {:upvalue-count 0 :arity 2 :constants ("mock-render-fragment" "assert" "=" "len" 1 "str" "Expected single render root in " " but got " " element(s). " "Multi-body let/begin in render-to-html/render-to-dom renders " "ALL expressions — put side effects in let bindings.") :bytecode (20 0 0 16 0 48 1 17 2 20 1 0 16 2 52 3 0 1 1 4 0 52 2 0 2 1 6 0 16 1 1 7 0 16 2 52 3 0 1 1 8 0 1 9 0 1 10 0 52 5 0 7 49 2 50)} "assert-tag" {:upvalue-count 0 :arity 2 :constants ("assert" "=" "get" "tag" "str" "Expected <" "> but got <" ">") :bytecode (20 0 0 16 0 1 3 0 52 2 0 2 16 1 52 1 0 2 1 5 0 16 1 1 6 0 16 0 1 3 0 52 2 0 2 1 7 0 52 4 0 5 49 2 50)}) :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 51 31 0 128 30 0 5 51 33 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 5 51 47 0 128 46 0 5 51 49 0 128 48 0 5 51 51 0 128 50 0 5 51 53 0 128 52 0 50)))
|