Bytecode compiler now emits OP_PERFORM for (import ...) and compiles
(define-library ...) bodies. The VM stores the import request in
globals["__io_request"] and stops the run loop — no exceptions needed.
vm-execute-module returns a suspension dict, vm-resume-module continues.
Browser: sx_browser.ml detects suspension dicts from execute_module and
returns JS {suspended, op, request, resume} objects. The sx-platform.js
while loop handles cascading suspensions via handleImportSuspension.
13 modules load via .sxbc bytecode in 226ms (manifest-driven), both
islands hydrate, all handlers wired. 2650/2650 tests pass including
6 new vm-import-suspension tests.
Also: consolidated sx-platform-2.js → sx-platform.js, fixed
vm-execute-module missing code-from-value call, fixed bootstrap.py
protocol registry transpiler issues.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 lines
14 KiB
Plaintext
4 lines
14 KiB
Plaintext
(sxbc 1 "efbbf5d601b263b4"
|
|
(code
|
|
:constants ("dom-document" {:upvalue-count 0 :arity 0 :constants ("host-global" "document") :bytecode (20 0 0 1 1 0 49 1 50)} "dom-window" {:upvalue-count 0 :arity 0 :constants ("host-global" "window") :bytecode (20 0 0 1 1 0 49 1 50)} "dom-body" {:upvalue-count 0 :arity 0 :constants ("host-get" "dom-document" "body") :bytecode (20 0 0 20 1 0 48 0 1 2 0 49 2 50)} "dom-head" {:upvalue-count 0 :arity 0 :constants ("host-get" "dom-document" "head") :bytecode (20 0 0 20 1 0 48 0 1 2 0 49 2 50)} "dom-create-element" {:upvalue-count 0 :arity 2 :constants ("host-call" "dom-document" "createElementNS" "createElement") :bytecode (16 1 33 20 0 20 0 0 20 1 0 48 0 1 2 0 16 1 16 0 49 4 32 15 0 20 0 0 20 1 0 48 0 1 3 0 16 0 49 3 50)} "create-text-node" {:upvalue-count 0 :arity 1 :constants ("host-call" "dom-document" "createTextNode") :bytecode (20 0 0 20 1 0 48 0 1 2 0 16 0 49 3 50)} "create-fragment" {:upvalue-count 0 :arity 0 :constants ("host-call" "dom-document" "createDocumentFragment") :bytecode (20 0 0 20 1 0 48 0 1 2 0 49 2 50)} "create-comment" {:upvalue-count 0 :arity 1 :constants ("host-call" "dom-document" "createComment" "") :bytecode (20 0 0 20 1 0 48 0 1 2 0 16 0 6 34 4 0 5 1 3 0 49 3 50)} "dom-append" {:upvalue-count 0 :arity 2 :constants ("host-call" "appendChild") :bytecode (16 0 6 33 3 0 5 16 1 33 15 0 20 0 0 16 0 1 1 0 16 1 49 3 32 1 0 2 50)} "dom-prepend" {:upvalue-count 0 :arity 2 :constants ("host-call" "prepend") :bytecode (16 0 6 33 3 0 5 16 1 33 15 0 20 0 0 16 0 1 1 0 16 1 49 3 32 1 0 2 50)} "dom-insert-before" {:upvalue-count 0 :arity 3 :constants ("host-call" "insertBefore") :bytecode (16 0 6 33 3 0 5 16 1 33 17 0 20 0 0 16 0 1 1 0 16 1 16 2 49 4 32 1 0 2 50)} "dom-insert-after" {:upvalue-count 0 :arity 2 :constants ("Insert node after ref in the same parent." "host-get" "parentNode" "nextSibling" "host-call" "insertBefore" "appendChild") :bytecode (1 0 0 5 20 1 0 16 0 1 2 0 48 2 17 2 20 1 0 16 0 1 3 0 48 2 17 3 16 2 33 37 0 16 3 33 17 0 20 4 0 16 2 1 5 0 16 1 16 3 49 4 32 12 0 20 4 0 16 2 1 6 0 16 1 49 3 32 1 0 2 50)} "dom-remove" {:upvalue-count 0 :arity 1 :constants ("host-call" "remove") :bytecode (16 0 33 13 0 20 0 0 16 0 1 1 0 49 2 32 1 0 2 50)} "dom-is-active-element?" {:upvalue-count 0 :arity 1 :constants ("host-get" "dom-document" "activeElement" "identical?") :bytecode (20 0 0 20 1 0 48 0 1 2 0 48 2 17 1 16 1 6 33 3 0 5 16 0 33 11 0 16 0 16 1 52 3 0 2 32 1 0 4 50)} "dom-is-input-element?" {:upvalue-count 0 :arity 1 :constants ("upper" "dom-tag-name" "" "=" "INPUT" "TEXTAREA" "SELECT") :bytecode (20 1 0 16 0 48 1 6 34 4 0 5 1 2 0 52 0 0 1 17 1 16 1 1 4 0 52 3 0 2 6 34 24 0 5 16 1 1 5 0 52 3 0 2 6 34 10 0 5 16 1 1 6 0 52 3 0 2 50)} "dom-is-child-of?" {:upvalue-count 0 :arity 2 :constants ("host-call" "contains") :bytecode (16 0 6 33 20 0 5 16 1 6 33 13 0 5 20 0 0 16 1 1 1 0 16 0 49 3 50)} "dom-attr-list" {:upvalue-count 0 :arity 1 :constants ("host-get" "attributes" "list" "length" {:upvalue-count 4 :arity 1 :constants ("<" "host-call" "item" "append!" "list" "host-get" "name" "value" "+" 1) :bytecode (16 0 18 0 52 0 0 2 33 61 0 20 1 0 18 1 1 2 0 16 0 48 3 17 1 18 2 20 5 0 16 1 1 6 0 48 2 20 5 0 16 1 1 7 0 48 2 52 4 0 2 52 3 0 2 5 18 3 16 0 1 9 0 52 8 0 2 49 1 32 1 0 2 50)} 0) :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 52 2 0 0 17 2 16 1 33 38 0 20 0 0 16 1 1 3 0 48 2 17 3 2 17 4 51 4 0 1 3 1 1 1 2 1 4 17 4 16 4 1 5 0 48 1 32 1 0 2 5 16 2 50)} "dom-remove-child" {:upvalue-count 0 :arity 2 :constants ("host-call" "removeChild") :bytecode (16 0 6 33 3 0 5 16 1 33 15 0 20 0 0 16 0 1 1 0 16 1 49 3 32 1 0 2 50)} "dom-replace-child" {:upvalue-count 0 :arity 3 :constants ("host-call" "replaceChild") :bytecode (16 0 6 33 10 0 5 16 1 6 33 3 0 5 16 2 33 17 0 20 0 0 16 0 1 1 0 16 1 16 2 49 4 32 1 0 2 50)} "dom-clone" {:upvalue-count 0 :arity 2 :constants ("host-call" "cloneNode" "nil?") :bytecode (20 0 0 16 0 1 1 0 16 1 52 2 0 1 33 4 0 3 32 2 0 16 1 49 3 50)} "dom-query" {:upvalue-count 0 :arity 2 :constants ("nil?" "host-call" "dom-document" "querySelector") :bytecode (16 1 52 0 0 1 33 18 0 20 1 0 20 2 0 48 0 1 3 0 16 0 49 3 32 12 0 20 1 0 16 0 1 3 0 16 1 49 3 50)} "dom-query-all" {:upvalue-count 0 :arity 2 :constants ("Query DOM and return an SX list (not a host NodeList)." "nil?" "host-call" "dom-document" "querySelectorAll" "list" "host-get" "length" {:upvalue-count 4 :arity 1 :constants ("<" "append!" "host-call" "item" "+" 1) :bytecode (16 0 18 0 52 0 0 2 33 35 0 18 1 20 2 0 18 2 1 3 0 16 0 48 3 52 1 0 2 5 18 3 16 0 1 5 0 52 4 0 2 49 1 32 1 0 2 50)} 0) :bytecode (1 0 0 5 16 1 52 1 0 1 33 18 0 20 2 0 20 3 0 48 0 1 4 0 16 0 48 3 32 12 0 20 2 0 16 0 1 4 0 16 1 48 3 17 2 16 2 52 1 0 1 33 7 0 52 5 0 0 32 44 0 20 6 0 16 2 1 7 0 48 2 17 3 52 5 0 0 17 4 2 17 5 51 8 0 1 3 1 4 1 2 1 5 17 5 16 5 1 9 0 48 1 5 16 4 50)} "dom-query-by-id" {:upvalue-count 0 :arity 1 :constants ("host-call" "dom-document" "getElementById") :bytecode (20 0 0 20 1 0 48 0 1 2 0 16 0 49 3 50)} "dom-closest" {:upvalue-count 0 :arity 2 :constants ("host-call" "closest") :bytecode (16 0 33 15 0 20 0 0 16 0 1 1 0 16 1 49 3 32 1 0 2 50)} "dom-matches?" {:upvalue-count 0 :arity 2 :constants ("host-get" "matches" "host-call") :bytecode (16 0 6 33 11 0 5 20 0 0 16 0 1 1 0 48 2 33 15 0 20 2 0 16 0 1 1 0 16 1 49 3 32 1 0 4 50)} "dom-get-attr" {:upvalue-count 0 :arity 2 :constants ("host-get" "getAttribute" "host-call" "nil?") :bytecode (16 0 6 33 11 0 5 20 0 0 16 0 1 1 0 48 2 33 32 0 20 2 0 16 0 1 1 0 16 1 48 3 17 2 16 2 52 3 0 1 33 4 0 2 32 2 0 16 2 32 1 0 2 50)} "dom-set-attr" {:upvalue-count 0 :arity 3 :constants ("host-get" "setAttribute" "host-call") :bytecode (16 0 6 33 11 0 5 20 0 0 16 0 1 1 0 48 2 33 17 0 20 2 0 16 0 1 1 0 16 1 16 2 49 4 32 1 0 2 50)} "dom-remove-attr" {:upvalue-count 0 :arity 2 :constants ("host-get" "removeAttribute" "host-call") :bytecode (16 0 6 33 11 0 5 20 0 0 16 0 1 1 0 48 2 33 15 0 20 2 0 16 0 1 1 0 16 1 49 3 32 1 0 2 50)} "dom-has-attr?" {:upvalue-count 0 :arity 2 :constants ("host-get" "hasAttribute" "host-call") :bytecode (16 0 6 33 11 0 5 20 0 0 16 0 1 1 0 48 2 33 15 0 20 2 0 16 0 1 1 0 16 1 49 3 32 1 0 4 50)} "dom-add-class" {:upvalue-count 0 :arity 2 :constants ("host-call" "host-get" "classList" "add") :bytecode (16 0 33 23 0 20 0 0 20 1 0 16 0 1 2 0 48 2 1 3 0 16 1 49 3 32 1 0 2 50)} "dom-remove-class" {:upvalue-count 0 :arity 2 :constants ("host-call" "host-get" "classList" "remove") :bytecode (16 0 33 23 0 20 0 0 20 1 0 16 0 1 2 0 48 2 1 3 0 16 1 49 3 32 1 0 2 50)} "dom-has-class?" {:upvalue-count 0 :arity 2 :constants ("host-call" "host-get" "classList" "contains") :bytecode (16 0 33 23 0 20 0 0 20 1 0 16 0 1 2 0 48 2 1 3 0 16 1 49 3 32 1 0 4 50)} "dom-text-content" {:upvalue-count 0 :arity 1 :constants ("host-get" "textContent") :bytecode (20 0 0 16 0 1 1 0 49 2 50)} "dom-set-text-content" {:upvalue-count 0 :arity 2 :constants ("host-set!" "textContent") :bytecode (20 0 0 16 0 1 1 0 16 1 49 3 50)} "dom-inner-html" {:upvalue-count 0 :arity 1 :constants ("host-get" "innerHTML") :bytecode (20 0 0 16 0 1 1 0 49 2 50)} "dom-set-inner-html" {:upvalue-count 0 :arity 2 :constants ("host-set!" "innerHTML") :bytecode (20 0 0 16 0 1 1 0 16 1 49 3 50)} "dom-outer-html" {:upvalue-count 0 :arity 1 :constants ("host-get" "outerHTML") :bytecode (20 0 0 16 0 1 1 0 49 2 50)} "dom-insert-adjacent-html" {:upvalue-count 0 :arity 3 :constants ("host-call" "insertAdjacentHTML") :bytecode (20 0 0 16 0 1 1 0 16 1 16 2 49 4 50)} "dom-get-style" {:upvalue-count 0 :arity 2 :constants ("host-get" "style") :bytecode (20 0 0 20 0 0 16 0 1 1 0 48 2 16 1 49 2 50)} "dom-set-style" {:upvalue-count 0 :arity 3 :constants ("host-call" "host-get" "style" "setProperty") :bytecode (20 0 0 20 1 0 16 0 1 2 0 48 2 1 3 0 16 1 16 2 49 4 50)} "dom-get-prop" {:upvalue-count 0 :arity 2 :constants ("host-get") :bytecode (20 0 0 16 0 16 1 49 2 50)} "dom-set-prop" {:upvalue-count 0 :arity 3 :constants ("host-set!") :bytecode (20 0 0 16 0 16 1 16 2 49 3 50)} "dom-tag-name" {:upvalue-count 0 :arity 1 :constants ("lower" "host-get" "tagName" "") :bytecode (16 0 33 25 0 20 1 0 16 0 1 2 0 48 2 6 34 4 0 5 1 3 0 52 0 0 1 32 3 0 1 3 0 50)} "dom-node-type" {:upvalue-count 0 :arity 1 :constants ("host-get" "nodeType") :bytecode (20 0 0 16 0 1 1 0 49 2 50)} "dom-node-name" {:upvalue-count 0 :arity 1 :constants ("host-get" "nodeName") :bytecode (20 0 0 16 0 1 1 0 49 2 50)} "dom-id" {:upvalue-count 0 :arity 1 :constants ("host-get" "id") :bytecode (20 0 0 16 0 1 1 0 49 2 50)} "dom-parent" {:upvalue-count 0 :arity 1 :constants ("host-get" "parentNode") :bytecode (20 0 0 16 0 1 1 0 49 2 50)} "dom-first-child" {:upvalue-count 0 :arity 1 :constants ("host-get" "firstChild") :bytecode (20 0 0 16 0 1 1 0 49 2 50)} "dom-next-sibling" {:upvalue-count 0 :arity 1 :constants ("host-get" "nextSibling") :bytecode (20 0 0 16 0 1 1 0 49 2 50)} "dom-child-list" {:upvalue-count 0 :arity 1 :constants ("Return child nodes as an SX list." "host-get" "childNodes" "length" "list" {:upvalue-count 4 :arity 1 :constants ("<" "append!" "host-call" "item" "+" 1) :bytecode (16 0 18 0 52 0 0 2 33 35 0 18 1 20 2 0 18 2 1 3 0 16 0 48 3 52 1 0 2 5 18 3 16 0 1 5 0 52 4 0 2 49 1 32 1 0 2 50)} 0) :bytecode (1 0 0 5 16 0 33 59 0 20 1 0 16 0 1 2 0 48 2 17 1 20 1 0 16 1 1 3 0 48 2 17 2 52 4 0 0 17 3 2 17 4 51 5 0 1 2 1 3 1 1 1 4 17 4 16 4 1 6 0 48 1 5 16 3 32 4 0 52 4 0 0 50)} "dom-is-fragment?" {:upvalue-count 0 :arity 1 :constants ("=" "host-get" "nodeType" 11) :bytecode (20 1 0 16 0 1 2 0 48 2 1 3 0 52 0 0 2 50)} "dom-child-nodes" "dom-remove-children-after" {:upvalue-count 0 :arity 1 :constants ("Remove all siblings after marker node." "dom-parent" {:upvalue-count 3 :arity 0 :constants ("dom-next-sibling" "host-call" "removeChild") :bytecode (20 0 0 18 0 48 1 17 0 16 0 33 20 0 20 1 0 18 1 1 2 0 16 0 48 3 5 18 2 49 0 32 1 0 2 50)}) :bytecode (1 0 0 5 20 1 0 16 0 48 1 17 1 16 1 33 21 0 2 17 2 51 2 0 1 0 1 1 1 2 17 2 16 2 49 0 32 1 0 2 50)} "dom-focus" {:upvalue-count 0 :arity 1 :constants ("host-call" "focus") :bytecode (16 0 33 13 0 20 0 0 16 0 1 1 0 49 2 32 1 0 2 50)} "dom-parse-html" {:upvalue-count 0 :arity 1 :constants ("host-new" "DOMParser" "host-call" "parseFromString" "text/html" "host-get" "body" "childNodes") :bytecode (20 0 0 1 1 0 48 1 17 1 20 2 0 16 1 1 3 0 16 0 1 4 0 48 4 17 2 20 5 0 20 5 0 16 2 1 6 0 48 2 1 7 0 49 2 50)} "dom-listen" {:upvalue-count 0 :arity 3 :constants ("host-callback" "host-call" "addEventListener" {:upvalue-count 3 :arity 0 :constants ("host-call" "removeEventListener") :bytecode (20 0 0 18 0 1 1 0 18 1 18 2 49 4 50)}) :bytecode (20 0 0 16 2 48 1 17 3 20 1 0 16 0 1 2 0 16 1 16 3 48 4 5 51 3 0 1 0 1 1 1 3 50)} "dom-add-listener" {:upvalue-count 0 :arity 4 :constants ("host-callback" "host-call" "addEventListener" {:upvalue-count 3 :arity 0 :constants ("host-call" "removeEventListener") :bytecode (20 0 0 18 0 1 1 0 18 1 18 2 49 4 50)}) :bytecode (20 0 0 16 2 48 1 17 4 16 3 33 19 0 20 1 0 16 0 1 2 0 16 1 16 4 16 3 48 5 32 14 0 20 1 0 16 0 1 2 0 16 1 16 4 48 4 5 51 3 0 1 0 1 1 1 4 50)} "dom-dispatch" {:upvalue-count 0 :arity 3 :constants ("host-new" "CustomEvent" "dict" "detail" "bubbles" "host-call" "dispatchEvent") :bytecode (20 0 0 1 1 0 16 1 1 3 0 16 2 1 4 0 3 52 2 0 4 48 3 17 3 20 5 0 16 0 1 6 0 16 3 49 3 50)} "event-detail" {:upvalue-count 0 :arity 1 :constants ("host-get" "detail") :bytecode (20 0 0 16 0 1 1 0 49 2 50)} "prevent-default" {:upvalue-count 0 :arity 1 :constants ("host-call" "preventDefault") :bytecode (16 0 33 13 0 20 0 0 16 0 1 1 0 49 2 32 1 0 2 50)} "stop-propagation" {:upvalue-count 0 :arity 1 :constants ("host-call" "stopPropagation") :bytecode (16 0 33 13 0 20 0 0 16 0 1 1 0 49 2 32 1 0 2 50)} "event-modifier-key?" {:upvalue-count 0 :arity 1 :constants ("host-get" "ctrlKey" "metaKey" "shiftKey" "altKey") :bytecode (16 0 6 33 56 0 5 20 0 0 16 0 1 1 0 48 2 6 34 41 0 5 20 0 0 16 0 1 2 0 48 2 6 34 26 0 5 20 0 0 16 0 1 3 0 48 2 6 34 11 0 5 20 0 0 16 0 1 4 0 49 2 50)} "element-value" {:upvalue-count 0 :arity 1 :constants ("not" "nil?" "host-get" "value") :bytecode (16 0 6 33 19 0 5 20 2 0 16 0 1 3 0 48 2 52 1 0 1 52 0 0 1 33 13 0 20 2 0 16 0 1 3 0 49 2 32 1 0 2 50)} "error-message" {:upvalue-count 0 :arity 1 :constants ("host-get" "message" "str") :bytecode (16 0 6 33 11 0 5 20 0 0 16 0 1 1 0 48 2 33 13 0 20 0 0 16 0 1 1 0 49 2 32 6 0 16 0 52 2 0 1 50)} "dom-get-data" {:upvalue-count 0 :arity 2 :constants ("host-get" "__sx_data") :bytecode (20 0 0 16 0 1 1 0 48 2 17 2 16 2 33 12 0 20 0 0 16 2 16 1 49 2 32 1 0 2 50)} "dom-set-data" {:upvalue-count 0 :arity 3 :constants ("not" "host-get" "__sx_data" "host-set!" "dict") :bytecode (20 1 0 16 0 1 2 0 48 2 52 0 0 1 33 17 0 20 3 0 16 0 1 2 0 52 4 0 0 48 3 32 1 0 2 5 20 3 0 20 1 0 16 0 1 2 0 48 2 16 1 16 2 49 3 50)} "dom-append-to-head" {:upvalue-count 0 :arity 1 :constants ("dom-head" "host-call" "appendChild") :bytecode (20 0 0 48 0 33 18 0 20 1 0 20 0 0 48 0 1 2 0 16 0 49 3 32 1 0 2 50)} "set-document-title" {:upvalue-count 0 :arity 1 :constants ("host-set!" "dom-document" "title") :bytecode (20 0 0 20 1 0 48 0 1 2 0 16 0 49 3 50)} {:library (sx dom) :op "import"}) :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 5 51 55 0 128 54 0 5 51 57 0 128 56 0 5 51 59 0 128 58 0 5 51 61 0 128 60 0 5 51 63 0 128 62 0 5 51 65 0 128 64 0 5 51 67 0 128 66 0 5 51 69 0 128 68 0 5 51 71 0 128 70 0 5 51 73 0 128 72 0 5 51 75 0 128 74 0 5 51 77 0 128 76 0 5 51 79 0 128 78 0 5 51 81 0 128 80 0 5 51 83 0 128 82 0 5 51 85 0 128 84 0 5 51 87 0 128 86 0 5 51 89 0 128 88 0 5 51 91 0 128 90 0 5 51 93 0 128 92 0 5 51 95 0 128 94 0 5 51 97 0 128 96 0 5 51 99 0 128 98 0 5 51 101 0 128 100 0 5 51 99 0 128 102 0 5 51 104 0 128 103 0 5 51 106 0 128 105 0 5 51 108 0 128 107 0 5 51 110 0 128 109 0 5 51 112 0 128 111 0 5 51 114 0 128 113 0 5 51 116 0 128 115 0 5 51 118 0 128 117 0 5 51 120 0 128 119 0 5 51 122 0 128 121 0 5 51 124 0 128 123 0 5 51 126 0 128 125 0 5 51 128 0 128 127 0 5 51 130 0 128 129 0 5 51 132 0 128 131 0 5 51 134 0 128 133 0 5 1 135 0 112 50)))
|