From 5ac1ca975697eef2cbc64aa185922e952fdf0455 Mon Sep 17 00:00:00 2001 From: giles Date: Sat, 4 Apr 2026 22:52:41 +0000 Subject: [PATCH] Fix server import suspension, dist sync, JIT errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - cek_run patched to handle import suspensions via _import_hook. define-library (import ...) now resolves cleanly on the server. IO suspension errors: 190 → 0. JIT failures: ~50 → 0. - _import_hook wired in sx_server.ml to load .sx files on demand. - compile-modules.js syncs source .sx files to dist/sx/ before compiling — eliminates stale bytecode from out-of-date copies. - WASM binary rebuilt with all fixes. - 2658/2658 tests pass (8 new — previously failing import tests). Co-Authored-By: Claude Opus 4.6 (1M context) --- hosts/ocaml/bin/sx_server.ml | 12 + hosts/ocaml/browser/compile-modules.js | 41 +++ hosts/ocaml/lib/sx_ref.ml | 37 ++- shared/static/wasm/sx/core-signals.sx | 371 +++++++++++------------ shared/static/wasm/sx/deps.sx | 113 ++++--- shared/static/wasm/sx/deps.sxbc | 4 +- shared/static/wasm/sx/freeze.sx | 169 ++++++----- shared/static/wasm/sx/freeze.sxbc | 2 +- shared/static/wasm/sx/vm.sx | 133 ++++---- shared/static/wasm/sx/vm.sxbc | 4 +- shared/static/wasm/sx_browser.bc.wasm.js | 2 +- 11 files changed, 480 insertions(+), 408 deletions(-) diff --git a/hosts/ocaml/bin/sx_server.ml b/hosts/ocaml/bin/sx_server.ml index 919d4da4..9c1d31e1 100644 --- a/hosts/ocaml/bin/sx_server.ml +++ b/hosts/ocaml/bin/sx_server.ml @@ -783,6 +783,18 @@ let () = if not (Sx_primitives.is_primitive name) then Hashtbl.replace _shared_vm_globals name v) +(* Import hook — resolves (import ...) suspensions inside eval_expr/cek_run. + Loads the .sx file for the library, registers it, and returns true. *) +let () = + Sx_types._import_hook := Some (fun lib_spec -> + let key = Sx_ref.library_name_key lib_spec in + if Sx_types.sx_truthy (Sx_ref.library_loaded_p key) then true + else match resolve_library_path lib_spec with + | Some path -> + (try load_library_file path; true + with _ -> false) + | None -> false) + let make_server_env () = let env = make_env () in Sx_render.setup_render_env env; diff --git a/hosts/ocaml/browser/compile-modules.js b/hosts/ocaml/browser/compile-modules.js index a4321fdf..24fcbe13 100644 --- a/hosts/ocaml/browser/compile-modules.js +++ b/hosts/ocaml/browser/compile-modules.js @@ -16,12 +16,53 @@ const { execSync, spawnSync } = require('child_process'); const distDir = process.argv[2] || path.join(__dirname, 'dist'); const sxDir = path.join(distDir, 'sx'); +const projectRoot = path.resolve(__dirname, '..', '..', '..'); if (!fs.existsSync(sxDir)) { console.error('sx dir not found:', sxDir); process.exit(1); } +// Sync source .sx files to dist/sx/ before compiling. +// Source locations: spec/ for core, lib/ for compiler/vm, web/ and web/lib/ for web stack. +const SOURCE_MAP = { + // spec/ + 'render.sx': 'spec/render.sx', + 'core-signals.sx': 'spec/signals.sx', + // lib/ + 'bytecode.sx': 'lib/bytecode.sx', 'compiler.sx': 'lib/compiler.sx', + 'vm.sx': 'lib/vm.sx', 'freeze.sx': 'lib/freeze.sx', + 'highlight.sx': 'lib/highlight.sx', + // web/lib/ + 'dom.sx': 'web/lib/dom.sx', 'browser.sx': 'web/lib/browser.sx', + // web/ + 'signals.sx': 'web/signals.sx', 'deps.sx': 'web/deps.sx', + 'router.sx': 'web/router.sx', 'page-helpers.sx': 'web/page-helpers.sx', + 'adapter-html.sx': 'web/adapter-html.sx', 'adapter-sx.sx': 'web/adapter-sx.sx', + 'adapter-dom.sx': 'web/adapter-dom.sx', + 'boot-helpers.sx': 'web/lib/boot-helpers.sx', + 'hypersx.sx': 'web/hypersx.sx', + 'harness.sx': 'spec/harness.sx', 'harness-reactive.sx': 'web/harness-reactive.sx', + 'harness-web.sx': 'web/harness-web.sx', + 'engine.sx': 'web/engine.sx', 'orchestration.sx': 'web/orchestration.sx', + 'boot.sx': 'web/boot.sx', + 'tw-layout.sx': 'web/tw-layout.sx', 'tw-type.sx': 'web/tw-type.sx', 'tw.sx': 'web/tw.sx', +}; +let synced = 0; +for (const [dist, src] of Object.entries(SOURCE_MAP)) { + const srcPath = path.join(projectRoot, src); + const dstPath = path.join(sxDir, dist); + if (fs.existsSync(srcPath)) { + const srcContent = fs.readFileSync(srcPath); + const dstExists = fs.existsSync(dstPath); + if (!dstExists || !fs.readFileSync(dstPath).equals(srcContent)) { + fs.writeFileSync(dstPath, srcContent); + synced++; + } + } +} +if (synced > 0) console.log('Synced ' + synced + ' source files to dist/sx/'); + // Find the native OCaml binary const binPaths = [ path.join(__dirname, '..', '_build', 'default', 'bin', 'sx_server.exe'), diff --git a/hosts/ocaml/lib/sx_ref.ml b/hosts/ocaml/lib/sx_ref.ml index ed7ab2f2..f8668b27 100644 --- a/hosts/ocaml/lib/sx_ref.ml +++ b/hosts/ocaml/lib/sx_ref.ml @@ -488,7 +488,21 @@ and cek_step_loop state = (* cek-run *) and cek_run state = - (let final = (cek_step_loop (state)) in (if sx_truthy ((cek_suspended_p (final))) then (raise (Eval_error (value_to_str (String "IO suspension in non-IO context")))) else (cek_value (final)))) + (let rec run s = + let final = cek_step_loop s in + if sx_truthy (cek_suspended_p final) then begin + let request = cek_io_request final in + let op = match request with Dict d -> (match Hashtbl.find_opt d "op" with Some (String s) -> s | _ -> "") | _ -> "" in + if op = "import" then + let lib_spec = match request with Dict d -> (match Hashtbl.find_opt d "library" with Some v -> v | _ -> Nil) | _ -> Nil in + let key = library_name_key lib_spec in + let resolved = sx_truthy (library_loaded_p key) || + (match !_import_hook with Some hook -> hook lib_spec | None -> false) in + if resolved then run (cek_resume final Nil) + else raise (Eval_error "IO suspension in non-IO context") + else raise (Eval_error "IO suspension in non-IO context") + end else cek_value final + in run state) (* cek-resume *) and cek_resume suspended_state result' = @@ -815,7 +829,26 @@ let cek_run_iterative state = s := cek_step !s done; (match cek_suspended_p !s with - | Bool true -> raise (Eval_error "IO suspension in non-IO context") + | Bool true -> + let request = cek_io_request !s in + let op = match request with Dict d -> (match Hashtbl.find_opt d "op" with Some (String s) -> s | _ -> "") | _ -> "" in + if op = "import" then begin + let lib_spec = match request with Dict d -> (match Hashtbl.find_opt d "library" with Some v -> v | _ -> Nil) | _ -> Nil in + let key = library_name_key lib_spec in + let resolved = sx_truthy (library_loaded_p key) || + (match !_import_hook with Some hook -> hook lib_spec | None -> false) in + if resolved then begin + s := cek_resume !s Nil; + (* Continue the step loop after resolving the import *) + while not (match cek_terminal_p !s with Bool true -> true | _ -> false) + && not (match cek_suspended_p !s with Bool true -> true | _ -> false) do + s := cek_step !s + done; + (match cek_suspended_p !s with + | Bool true -> raise (Eval_error "IO suspension in non-IO context") + | _ -> cek_value !s) + end else raise (Eval_error "IO suspension in non-IO context") + end else raise (Eval_error "IO suspension in non-IO context") | _ -> cek_value !s) with Eval_error msg -> _last_error_kont_ref := cek_kont !s; diff --git a/shared/static/wasm/sx/core-signals.sx b/shared/static/wasm/sx/core-signals.sx index da8f8885..db112d87 100644 --- a/shared/static/wasm/sx/core-signals.sx +++ b/shared/static/wasm/sx/core-signals.sx @@ -1,6 +1,7 @@ -(define-library (sx signals) +(define-library + (sx signals) (export make-signal signal? @@ -26,205 +27,193 @@ with-island-scope register-in-scope) (begin - -(define - make-signal - (fn - (value) - (dict "__signal" true "value" value "subscribers" (list) "deps" (list)))) - -(define signal? (fn (x) (and (dict? x) (has-key? x "__signal")))) - -(define signal-value (fn (s) (get s "value"))) - -(define signal-set-value! (fn (s v) (dict-set! s "value" v))) - -(define signal-subscribers (fn (s) (get s "subscribers"))) - -(define - signal-add-sub! - (fn - (s f) - (when - (not (contains? (get s "subscribers") f)) - (dict-set! s "subscribers" (append (get s "subscribers") (list f)))))) - -(define - signal-remove-sub! - (fn - (s f) - (dict-set! - s - "subscribers" - (filter (fn (sub) (not (identical? sub f))) (get s "subscribers"))))) - -(define signal-deps (fn (s) (get s "deps"))) - -(define signal-set-deps! (fn (s deps) (dict-set! s "deps" deps))) - -(define - signal - :effects () - (fn ((initial-value :as any)) (make-signal initial-value))) - -(define - deref - :effects () - (fn - ((s :as any)) - (if - (not (signal? s)) - s - (let - ((ctx (context "sx-reactive" nil))) + (define + make-signal + (fn + (value) + (dict + "__signal" + true + "value" + value + "subscribers" + (list) + "deps" + (list)))) + (define signal? (fn (x) (and (dict? x) (has-key? x "__signal")))) + (define signal-value (fn (s) (get s "value"))) + (define signal-set-value! (fn (s v) (dict-set! s "value" v))) + (define signal-subscribers (fn (s) (get s "subscribers"))) + (define + signal-add-sub! + (fn + (s f) (when - ctx + (not (contains? (get s "subscribers") f)) + (dict-set! + s + "subscribers" + (append (get s "subscribers") (list f)))))) + (define + signal-remove-sub! + (fn + (s f) + (dict-set! + s + "subscribers" + (filter + (fn (sub) (not (identical? sub f))) + (get s "subscribers"))))) + (define signal-deps (fn (s) (get s "deps"))) + (define signal-set-deps! (fn (s deps) (dict-set! s "deps" deps))) + (define + signal + :effects () + (fn ((initial-value :as any)) (make-signal initial-value))) + (define + deref + :effects () + (fn + ((s :as any)) + (if + (not (signal? s)) + s (let - ((dep-list (get ctx "deps")) (notify-fn (get ctx "notify"))) + ((ctx (context "sx-reactive" nil))) (when - (not (contains? dep-list s)) - (append! dep-list s) - (signal-add-sub! s notify-fn)))) - (signal-value s))))) - -(define - reset! - :effects (mutation) - (fn - ((s :as signal) value) - (when - (signal? s) - (let - ((old (signal-value s))) + ctx + (let + {:notify notify-fn :deps dep-list} + ctx + (when + (not (contains? dep-list s)) + (append! dep-list s) + (signal-add-sub! s notify-fn)))) + (signal-value s))))) + (define + reset! + :effects (mutation) + (fn + ((s :as signal) value) (when - (not (identical? old value)) - (signal-set-value! s value) - (notify-subscribers s)))))) - -(define - swap! - :effects (mutation) - (fn - ((s :as signal) (f :as callable) &rest args) - (when - (signal? s) - (let - ((old (signal-value s)) - (new-val (trampoline (apply f (cons old args))))) + (signal? s) + (let + ((old (signal-value s))) + (when + (not (identical? old value)) + (signal-set-value! s value) + (notify-subscribers s)))))) + (define + swap! + :effects (mutation) + (fn + ((s :as signal) (f :as callable) &rest args) (when - (not (identical? old new-val)) - (signal-set-value! s new-val) - (notify-subscribers s)))))) - -(define - computed - :effects (mutation) - (fn - ((compute-fn :as lambda)) - (let - ((s (make-signal nil)) (deps (list)) (compute-ctx nil)) - (let - ((recompute (fn () (for-each (fn ((dep :as signal)) (signal-remove-sub! dep recompute)) (signal-deps s)) (signal-set-deps! s (list)) (let ((ctx (dict "deps" (list) "notify" recompute))) (scope-push! "sx-reactive" ctx) (let ((new-val (cek-call compute-fn nil))) (scope-pop! "sx-reactive") (signal-set-deps! s (get ctx "deps")) (let ((old (signal-value s))) (signal-set-value! s new-val) (when (not (identical? old new-val)) (notify-subscribers s)))))))) - (recompute) - (register-in-scope (fn () (dispose-computed s))) - s)))) - -(define - effect - :effects (mutation) - (fn - ((effect-fn :as lambda)) - (let - ((deps (list)) (disposed false) (cleanup-fn nil)) - (let - ((run-effect (fn () (when (not disposed) (when cleanup-fn (cek-call cleanup-fn nil)) (for-each (fn ((dep :as signal)) (signal-remove-sub! dep run-effect)) deps) (set! deps (list)) (let ((ctx (dict "deps" (list) "notify" run-effect))) (scope-push! "sx-reactive" ctx) (let ((result (cek-call effect-fn nil))) (scope-pop! "sx-reactive") (set! deps (get ctx "deps")) (when (callable? result) (set! cleanup-fn result)))))))) - (run-effect) + (signal? s) + (let + ((old (signal-value s)) + (new-val (trampoline (apply f (cons old args))))) + (when + (not (identical? old new-val)) + (signal-set-value! s new-val) + (notify-subscribers s)))))) + (define + computed + :effects (mutation) + (fn + ((compute-fn :as lambda)) (let - ((dispose-fn (fn () (set! disposed true) (when cleanup-fn (cek-call cleanup-fn nil)) (for-each (fn ((dep :as signal)) (signal-remove-sub! dep run-effect)) deps) (set! deps (list))))) - (register-in-scope dispose-fn) - dispose-fn))))) - -(define *batch-depth* 0) - -(define *batch-queue* (list)) - -(define - batch - :effects (mutation) - (fn - ((thunk :as lambda)) - (set! *batch-depth* (+ *batch-depth* 1)) - (cek-call thunk nil) - (set! *batch-depth* (- *batch-depth* 1)) - (when - (= *batch-depth* 0) - (let - ((queue *batch-queue*)) - (set! *batch-queue* (list)) + ((s (make-signal nil)) (deps (list)) (compute-ctx nil)) + (let + ((recompute (fn () (for-each (fn ((dep :as signal)) (signal-remove-sub! dep recompute)) (signal-deps s)) (signal-set-deps! s (list)) (let ((ctx (dict "deps" (list) "notify" recompute))) (scope-push! "sx-reactive" ctx) (let ((new-val (cek-call compute-fn nil))) (scope-pop! "sx-reactive") (signal-set-deps! s (get ctx "deps")) (let ((old (signal-value s))) (signal-set-value! s new-val) (when (not (identical? old new-val)) (notify-subscribers s)))))))) + (recompute) + (register-in-scope (fn () (dispose-computed s))) + s)))) + (define + effect + :effects (mutation) + (fn + ((effect-fn :as lambda)) (let - ((seen (list)) (pending (list))) - (for-each - (fn - ((s :as signal)) + ((deps (list)) (disposed false) (cleanup-fn nil)) + (let + ((run-effect (fn () (when (not disposed) (when cleanup-fn (cek-call cleanup-fn nil)) (for-each (fn ((dep :as signal)) (signal-remove-sub! dep run-effect)) deps) (set! deps (list)) (let ((ctx (dict "deps" (list) "notify" run-effect))) (scope-push! "sx-reactive" ctx) (let ((result (cek-call effect-fn nil))) (scope-pop! "sx-reactive") (set! deps (get ctx "deps")) (when (callable? result) (set! cleanup-fn result)))))))) + (run-effect) + (let + ((dispose-fn (fn () (set! disposed true) (when cleanup-fn (cek-call cleanup-fn nil)) (for-each (fn ((dep :as signal)) (signal-remove-sub! dep run-effect)) deps) (set! deps (list))))) + (register-in-scope dispose-fn) + dispose-fn))))) + (define *batch-depth* 0) + (define *batch-queue* (list)) + (define + batch + :effects (mutation) + (fn + ((thunk :as lambda)) + (set! *batch-depth* (+ *batch-depth* 1)) + (cek-call thunk nil) + (set! *batch-depth* (- *batch-depth* 1)) + (when + (= *batch-depth* 0) + (let + ((queue *batch-queue*)) + (set! *batch-queue* (list)) + (let + ((seen (list)) (pending (list))) (for-each (fn - ((sub :as lambda)) - (when - (not (contains? seen sub)) - (append! seen sub) - (append! pending sub))) - (signal-subscribers s))) - queue) - (for-each (fn ((sub :as lambda)) (sub)) pending)))))) - -(define - notify-subscribers - :effects (mutation) - (fn - ((s :as signal)) - (if - (> *batch-depth* 0) - (when (not (contains? *batch-queue* s)) (append! *batch-queue* s)) - (flush-subscribers s)))) - -(define - flush-subscribers - :effects (mutation) - (fn - ((s :as dict)) - (for-each (fn (sub) (cek-call sub nil)) (signal-subscribers s)))) - -(define - dispose-computed - :effects (mutation) - (fn - ((s :as signal)) - (when - (signal? s) - (for-each - (fn ((dep :as signal)) (signal-remove-sub! dep nil)) - (signal-deps s)) - (signal-set-deps! s (list))))) - -(define - with-island-scope - :effects (mutation) - (fn - ((scope-fn :as lambda) (body-fn :as lambda)) - (scope-push! "sx-island-scope" scope-fn) - (let ((result (body-fn))) (scope-pop! "sx-island-scope") result))) - -(define - register-in-scope - :effects (mutation) - (fn - ((disposable :as lambda)) - (let - ((collector (scope-peek "sx-island-scope"))) - (when collector (cek-call collector (list disposable)))))) - - -)) ;; end define-library + ((s :as signal)) + (for-each + (fn + ((sub :as lambda)) + (when + (not (contains? seen sub)) + (append! seen sub) + (append! pending sub))) + (signal-subscribers s))) + queue) + (for-each (fn ((sub :as lambda)) (sub)) pending)))))) + (define + notify-subscribers + :effects (mutation) + (fn + ((s :as signal)) + (if + (> *batch-depth* 0) + (when (not (contains? *batch-queue* s)) (append! *batch-queue* s)) + (flush-subscribers s)))) + (define + flush-subscribers + :effects (mutation) + (fn + ((s :as dict)) + (for-each (fn (sub) (cek-call sub nil)) (signal-subscribers s)))) + (define + dispose-computed + :effects (mutation) + (fn + ((s :as signal)) + (when + (signal? s) + (for-each + (fn ((dep :as signal)) (signal-remove-sub! dep nil)) + (signal-deps s)) + (signal-set-deps! s (list))))) + (define + with-island-scope + :effects (mutation) + (fn + ((scope-fn :as lambda) (body-fn :as lambda)) + (scope-push! "sx-island-scope" scope-fn) + (let ((result (body-fn))) (scope-pop! "sx-island-scope") result))) + (define + register-in-scope + :effects (mutation) + (fn + ((disposable :as lambda)) + (let + ((collector (scope-peek "sx-island-scope"))) + (when collector (cek-call collector (list disposable)))))))) ;; end define-library ;; Re-export to global namespace for backward compatibility (import (sx signals)) diff --git a/shared/static/wasm/sx/deps.sx b/shared/static/wasm/sx/deps.sx index ad15e720..2e69170d 100644 --- a/shared/static/wasm/sx/deps.sx +++ b/shared/static/wasm/sx/deps.sx @@ -40,7 +40,7 @@ (when (starts-with? name "~") (when (not (contains? refs name)) (append! refs name))))) - ("list" (for-each (fn (item) (scan-refs-walk item refs)) node)) + ("list" (for-each (fn (child) (scan-refs-walk child refs)) node)) ("dict" (for-each (fn (key) (scan-refs-walk (dict-get node key) refs)) @@ -56,27 +56,16 @@ (append! seen n) (let ((val (env-get env n))) - (match - (type-of val) - ("component" - (for-each - (fn - ((ref :as string)) - (transitive-deps-walk ref seen env)) - (scan-refs (component-body val)))) - ("island" - (for-each - (fn - ((ref :as string)) - (transitive-deps-walk ref seen env)) - (scan-refs (component-body val)))) - ("macro" - (for-each - (fn - ((ref :as string)) - (transitive-deps-walk ref seen env)) - (scan-refs (macro-body val)))) - (_ nil)))))) + (cond + (or (= (type-of val) "component") (= (type-of val) "island")) + (for-each + (fn ((ref :as string)) (transitive-deps-walk ref seen env)) + (scan-refs (component-body val))) + (= (type-of val) "macro") + (for-each + (fn ((ref :as string)) (transitive-deps-walk ref seen env)) + (scan-refs (macro-body val))) + :else nil))))) (define transitive-deps :effects () @@ -216,37 +205,36 @@ (append! seen n) (let ((val (env-get env n))) - (match - (type-of val) - ("component" - (do - (for-each - (fn - ((ref :as string)) - (when - (not (contains? all-refs ref)) - (append! all-refs ref))) - (scan-io-refs (component-body val) io-names)) - (for-each - (fn - ((dep :as string)) - (transitive-io-refs-walk dep seen all-refs env io-names)) - (scan-refs (component-body val))))) - ("macro" - (do - (for-each - (fn - ((ref :as string)) - (when - (not (contains? all-refs ref)) - (append! all-refs ref))) - (scan-io-refs (macro-body val) io-names)) - (for-each - (fn - ((dep :as string)) - (transitive-io-refs-walk dep seen all-refs env io-names)) - (scan-refs (macro-body val))))) - (_ nil)))))) + (cond + (= (type-of val) "component") + (do + (for-each + (fn + ((ref :as string)) + (when + (not (contains? all-refs ref)) + (append! all-refs ref))) + (scan-io-refs (component-body val) io-names)) + (for-each + (fn + ((dep :as string)) + (transitive-io-refs-walk dep seen all-refs env io-names)) + (scan-refs (component-body val)))) + (= (type-of val) "macro") + (do + (for-each + (fn + ((ref :as string)) + (when + (not (contains? all-refs ref)) + (append! all-refs ref))) + (scan-io-refs (macro-body val) io-names)) + (for-each + (fn + ((dep :as string)) + (transitive-io-refs-walk dep seen all-refs env io-names)) + (scan-refs (macro-body val)))) + :else nil))))) (define transitive-io-refs :effects () @@ -318,15 +306,16 @@ (if (not (= (type-of val) "component")) "server" - (match - (component-affinity val) - ("server" "server") - ("client" "client") - (_ - (if - (not (component-pure? name env io-names)) - "server" - "client")))))))) + (let + ((affinity (component-affinity val))) + (cond + (= affinity "server") + "server" + (= affinity "client") + "client" + (not (component-pure? name env io-names)) + "server" + :else "client"))))))) (define page-render-plan :effects () diff --git a/shared/static/wasm/sx/deps.sxbc b/shared/static/wasm/sx/deps.sxbc index 49be6526..7fc35614 100644 --- a/shared/static/wasm/sx/deps.sxbc +++ b/shared/static/wasm/sx/deps.sxbc @@ -1,3 +1,3 @@ -(sxbc 1 "2700b3cf8f9d35aa" +(sxbc 1 "809ddd596ff4bc3c" (code - :constants ("scan-refs" {:upvalue-count 0 :arity 1 :constants ("list" "scan-refs-walk") :bytecode (52 0 0 0 17 1 20 1 0 16 0 16 1 48 2 5 16 1 50)} "scan-refs-walk" {:upvalue-count 0 :arity 2 :constants ("type-of" "symbol" "=" "symbol-name" "starts-with?" "~" "not" "contains?" "append!" "list" "for-each" {:upvalue-count 1 :arity 1 :constants ("scan-refs-walk") :bytecode (20 0 0 16 0 18 0 49 2 50)} "dict" {:upvalue-count 2 :arity 1 :constants ("scan-refs-walk" "dict-get") :bytecode (20 0 0 18 0 16 0 52 1 0 2 18 1 49 2 50)} "keys") :bytecode (16 0 52 0 0 1 6 1 1 0 52 2 0 2 33 55 0 5 16 0 52 3 0 1 17 2 16 2 1 5 0 52 4 0 2 33 30 0 16 1 16 2 52 7 0 2 52 6 0 1 33 11 0 16 1 16 2 52 8 0 2 32 1 0 2 32 1 0 2 32 60 0 6 1 9 0 52 2 0 2 33 15 0 5 51 11 0 1 1 16 0 52 10 0 2 32 34 0 6 1 12 0 52 2 0 2 33 21 0 5 51 13 0 1 0 1 1 16 0 52 14 0 1 52 10 0 2 32 2 0 5 2 50)} "transitive-deps-walk" {:upvalue-count 0 :arity 3 :constants ("not" "contains?" "append!" "env-get" "type-of" "component" "=" "for-each" {:upvalue-count 2 :arity 1 :constants ("transitive-deps-walk") :bytecode (20 0 0 16 0 18 0 18 1 49 3 50)} "scan-refs" "component-body" "island" "macro" "macro-body") :bytecode (16 1 16 0 52 1 0 2 52 0 0 1 33 142 0 16 1 16 0 52 2 0 2 5 16 2 16 0 52 3 0 2 17 3 16 3 52 4 0 1 6 1 5 0 52 6 0 2 33 26 0 5 51 8 0 1 1 1 2 20 9 0 16 3 52 10 0 1 48 1 52 7 0 2 32 77 0 6 1 11 0 52 6 0 2 33 26 0 5 51 8 0 1 1 1 2 20 9 0 16 3 52 10 0 1 48 1 52 7 0 2 32 40 0 6 1 12 0 52 6 0 2 33 27 0 5 51 8 0 1 1 1 2 20 9 0 20 13 0 16 3 48 1 48 1 52 7 0 2 32 2 0 5 2 32 1 0 2 50)} "transitive-deps" {:upvalue-count 0 :arity 2 :constants ("list" "starts-with?" "~" "str" "transitive-deps-walk" "filter" {:upvalue-count 1 :arity 1 :constants ("not" "=") :bytecode (16 0 18 0 52 1 0 2 52 0 0 1 50)}) :bytecode (52 0 0 0 17 2 16 0 1 2 0 52 1 0 2 33 5 0 16 0 32 9 0 1 2 0 16 0 52 3 0 2 17 3 20 4 0 16 3 16 2 16 1 48 3 5 51 6 0 1 3 16 2 52 5 0 2 50)} "compute-all-deps" {:upvalue-count 0 :arity 1 :constants ("for-each" {:upvalue-count 1 :arity 1 :constants ("env-get" "=" "type-of" "component" "island" "component-set-deps!" "transitive-deps") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 1 3 0 52 1 0 2 6 34 14 0 5 16 1 52 2 0 1 1 4 0 52 1 0 2 33 19 0 20 5 0 16 1 20 6 0 16 0 18 0 48 2 49 2 32 1 0 2 50)} "env-components") :bytecode (51 1 0 1 0 20 2 0 16 0 48 1 52 0 0 2 50)} "scan-components-from-source" {:upvalue-count 0 :arity 1 :constants ("regex-find-all" "\\(~([a-zA-Z_][a-zA-Z0-9_\\-:/]*)" "map" {:upvalue-count 0 :arity 1 :constants ("str" "~") :bytecode (1 1 0 16 0 52 0 0 2 50)}) :bytecode (20 0 0 1 1 0 16 0 48 2 17 1 51 3 0 16 1 52 2 0 2 50)} "components-needed" {:upvalue-count 0 :arity 2 :constants ("scan-components-from-source" "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("not" "contains?" "append!" "env-get" "=" "type-of" "component" "empty?" "component-deps" "transitive-deps" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)}) :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 5 18 1 16 0 52 3 0 2 17 1 16 1 52 5 0 1 1 6 0 52 4 0 2 6 33 16 0 5 20 8 0 16 1 48 1 52 7 0 1 52 0 0 1 33 10 0 20 8 0 16 1 48 1 32 9 0 20 9 0 16 0 18 1 48 2 17 2 51 11 0 0 0 16 2 52 10 0 2 50)}) :bytecode (20 0 0 16 0 48 1 17 2 52 1 0 0 17 3 51 3 0 1 3 1 1 16 2 52 2 0 2 5 16 3 50)} "page-component-bundle" {:upvalue-count 0 :arity 2 :constants ("components-needed") :bytecode (20 0 0 16 0 16 1 49 2 50)} "page-css-classes" {:upvalue-count 0 :arity 2 :constants ("components-needed" "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("env-get" "=" "type-of" "component" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "component-css-classes") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 1 3 0 52 1 0 2 33 19 0 51 5 0 0 1 20 6 0 16 1 48 1 52 4 0 2 32 1 0 2 50)} {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "scan-css-classes") :bytecode (20 0 0 16 0 16 1 48 2 17 2 52 1 0 0 17 3 51 3 0 1 1 1 3 16 2 52 2 0 2 5 51 4 0 1 3 20 5 0 16 0 48 1 52 2 0 2 5 16 3 50)} "scan-io-refs-walk" {:upvalue-count 0 :arity 3 :constants ("type-of" "symbol" "=" "symbol-name" "contains?" "not" "append!" "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("scan-io-refs-walk") :bytecode (20 0 0 16 0 18 0 18 1 49 3 50)} "dict" {:upvalue-count 3 :arity 1 :constants ("scan-io-refs-walk" "dict-get") :bytecode (20 0 0 18 0 16 0 52 1 0 2 18 1 18 2 49 3 50)} "keys") :bytecode (16 0 52 0 0 1 6 1 1 0 52 2 0 2 33 54 0 5 16 0 52 3 0 1 17 3 16 1 16 3 52 4 0 2 33 30 0 16 2 16 3 52 4 0 2 52 5 0 1 33 11 0 16 2 16 3 52 6 0 2 32 1 0 2 32 1 0 2 32 64 0 6 1 7 0 52 2 0 2 33 17 0 5 51 9 0 1 1 1 2 16 0 52 8 0 2 32 36 0 6 1 10 0 52 2 0 2 33 23 0 5 51 11 0 1 0 1 1 1 2 16 0 52 12 0 1 52 8 0 2 32 2 0 5 2 50)} "scan-io-refs" {:upvalue-count 0 :arity 2 :constants ("list" "scan-io-refs-walk") :bytecode (52 0 0 0 17 2 20 1 0 16 0 16 1 16 2 48 3 5 16 2 50)} "transitive-io-refs-walk" {:upvalue-count 0 :arity 5 :constants ("not" "contains?" "append!" "env-get" "type-of" "component" "=" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "scan-io-refs" "component-body" {:upvalue-count 4 :arity 1 :constants ("transitive-io-refs-walk") :bytecode (20 0 0 16 0 18 0 18 1 18 2 18 3 49 5 50)} "scan-refs" "macro" "macro-body") :bytecode (16 1 16 0 52 1 0 2 52 0 0 1 33 160 0 16 1 16 0 52 2 0 2 5 16 3 16 0 52 3 0 2 17 5 16 5 52 4 0 1 6 1 5 0 52 6 0 2 33 53 0 5 51 8 0 1 2 20 9 0 16 5 52 10 0 1 16 4 48 2 52 7 0 2 5 51 11 0 1 1 1 2 1 3 1 4 20 12 0 16 5 52 10 0 1 48 1 52 7 0 2 32 68 0 6 1 13 0 52 6 0 2 33 55 0 5 51 8 0 1 2 20 9 0 20 14 0 16 5 48 1 16 4 48 2 52 7 0 2 5 51 11 0 1 1 1 2 1 3 1 4 20 12 0 20 14 0 16 5 48 1 48 1 52 7 0 2 32 2 0 5 2 32 1 0 2 50)} "transitive-io-refs" {:upvalue-count 0 :arity 3 :constants ("list" "starts-with?" "~" "str" "transitive-io-refs-walk") :bytecode (52 0 0 0 17 3 52 0 0 0 17 4 16 0 1 2 0 52 1 0 2 33 5 0 16 0 32 9 0 1 2 0 16 0 52 3 0 2 17 5 20 4 0 16 5 16 4 16 3 16 1 16 2 48 5 5 16 3 50)} "compute-all-io-refs" {:upvalue-count 0 :arity 2 :constants ("for-each" {:upvalue-count 2 :arity 1 :constants ("env-get" "=" "type-of" "component" "component-set-io-refs!" "transitive-io-refs") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 1 3 0 52 1 0 2 33 21 0 20 4 0 16 1 20 5 0 16 0 18 0 18 1 48 3 49 2 32 1 0 2 50)} "env-components") :bytecode (51 1 0 1 0 1 1 20 2 0 16 0 48 1 52 0 0 2 50)} "component-io-refs-cached" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "env-get" "=" "type-of" "component" "not" "nil?" "component-io-refs" "empty?" "transitive-io-refs") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 16 1 16 3 52 3 0 2 17 4 16 4 52 5 0 1 1 6 0 52 4 0 2 6 33 36 0 5 20 9 0 16 4 48 1 52 8 0 1 52 7 0 1 6 33 16 0 5 20 9 0 16 4 48 1 52 10 0 1 52 7 0 1 33 10 0 20 9 0 16 4 49 1 32 11 0 20 11 0 16 0 16 1 16 2 49 3 50)} "component-pure?" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "env-has?" "env-get" "=" "type-of" "component" "not" "nil?" "component-io-refs" "empty?" "transitive-io-refs") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 16 1 16 3 52 3 0 2 33 11 0 16 1 16 3 52 4 0 2 32 1 0 2 17 4 16 4 52 6 0 1 1 7 0 52 5 0 2 6 33 36 0 5 20 10 0 16 4 48 1 52 9 0 1 52 8 0 1 6 33 16 0 5 20 10 0 16 4 48 1 52 11 0 1 52 8 0 1 33 4 0 4 32 15 0 20 12 0 16 0 16 1 16 2 48 3 52 11 0 1 50)} "render-target" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "env-has?" "env-get" "not" "=" "type-of" "component" "server" "component-affinity" "client" "component-pure?") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 16 1 16 3 52 3 0 2 33 11 0 16 1 16 3 52 4 0 2 32 1 0 2 17 4 16 4 52 7 0 1 1 8 0 52 6 0 2 52 5 0 1 33 6 0 1 9 0 32 70 0 16 4 52 10 0 1 6 1 9 0 52 6 0 2 33 7 0 5 1 9 0 32 46 0 6 1 11 0 52 6 0 2 33 7 0 5 1 11 0 32 28 0 5 20 12 0 16 0 16 1 16 2 48 3 52 5 0 1 33 6 0 1 9 0 32 3 0 1 11 0 50)} "page-render-plan" {:upvalue-count 0 :arity 3 :constants ("components-needed" "dict" "list" "for-each" {:upvalue-count 6 :arity 1 :constants ("render-target" "dict-set!" "=" "server" "append!" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "component-io-refs-cached") :bytecode (20 0 0 16 0 18 0 18 1 48 3 17 1 18 2 16 0 16 1 52 1 0 3 5 16 1 1 3 0 52 2 0 2 33 32 0 18 3 16 0 52 4 0 2 5 51 6 0 0 4 20 7 0 16 0 18 0 18 1 48 3 52 5 0 2 32 8 0 18 5 16 0 52 4 0 2 50)} "io-deps" "server" "components" "client") :bytecode (20 0 0 16 0 16 1 48 2 17 3 52 1 0 0 17 4 52 2 0 0 17 5 52 2 0 0 17 6 52 2 0 0 17 7 51 4 0 1 1 1 2 1 4 1 5 1 7 1 6 16 3 52 3 0 2 5 1 5 0 16 7 1 6 0 16 5 1 7 0 16 4 1 8 0 16 6 65 4 0 50)} "env-components" {:upvalue-count 0 :arity 1 :constants ("filter" {:upvalue-count 1 :arity 1 :constants ("env-get" "component?" "macro?") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 1 0 1 6 34 7 0 5 16 1 52 2 0 1 50)} "keys") :bytecode (51 1 0 1 0 16 0 52 2 0 1 52 0 0 2 50)} {:library (web deps) :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 1 38 0 112 50))) + :constants ("scan-refs" {:upvalue-count 0 :arity 1 :constants ("list" "scan-refs-walk") :bytecode (52 0 0 0 17 1 20 1 0 16 0 16 1 48 2 5 16 1 50)} "scan-refs-walk" {:upvalue-count 0 :arity 2 :constants ("type-of" "symbol" "=" "symbol-name" "starts-with?" "~" "not" "contains?" "append!" "list" "for-each" {:upvalue-count 1 :arity 1 :constants ("scan-refs-walk") :bytecode (20 0 0 16 0 18 0 49 2 50)} "dict" {:upvalue-count 2 :arity 1 :constants ("scan-refs-walk" "dict-get") :bytecode (20 0 0 18 0 16 0 52 1 0 2 18 1 49 2 50)} "keys") :bytecode (16 0 52 0 0 1 6 1 1 0 52 2 0 2 33 55 0 5 16 0 52 3 0 1 17 2 16 2 1 5 0 52 4 0 2 33 30 0 16 1 16 2 52 7 0 2 52 6 0 1 33 11 0 16 1 16 2 52 8 0 2 32 1 0 2 32 1 0 2 32 60 0 6 1 9 0 52 2 0 2 33 15 0 5 51 11 0 1 1 16 0 52 10 0 2 32 34 0 6 1 12 0 52 2 0 2 33 21 0 5 51 13 0 1 0 1 1 16 0 52 14 0 1 52 10 0 2 32 2 0 5 2 50)} "transitive-deps-walk" {:upvalue-count 0 :arity 3 :constants ("not" "contains?" "append!" "env-get" "=" "type-of" "component" "island" "for-each" {:upvalue-count 2 :arity 1 :constants ("transitive-deps-walk") :bytecode (20 0 0 16 0 18 0 18 1 49 3 50)} "scan-refs" "component-body" "macro" "macro-body") :bytecode (16 1 16 0 52 1 0 2 52 0 0 1 33 124 0 16 1 16 0 52 2 0 2 5 16 2 16 0 52 3 0 2 17 3 16 3 52 5 0 1 1 6 0 52 4 0 2 6 34 14 0 5 16 3 52 5 0 1 1 7 0 52 4 0 2 33 25 0 51 9 0 1 1 1 2 20 10 0 16 3 52 11 0 1 48 1 52 8 0 2 32 43 0 16 3 52 5 0 1 1 12 0 52 4 0 2 33 26 0 51 9 0 1 1 1 2 20 10 0 20 13 0 16 3 48 1 48 1 52 8 0 2 32 1 0 2 32 1 0 2 50)} "transitive-deps" {:upvalue-count 0 :arity 2 :constants ("list" "starts-with?" "~" "str" "transitive-deps-walk" "filter" {:upvalue-count 1 :arity 1 :constants ("not" "=") :bytecode (16 0 18 0 52 1 0 2 52 0 0 1 50)}) :bytecode (52 0 0 0 17 2 16 0 1 2 0 52 1 0 2 33 5 0 16 0 32 9 0 1 2 0 16 0 52 3 0 2 17 3 20 4 0 16 3 16 2 16 1 48 3 5 51 6 0 1 3 16 2 52 5 0 2 50)} "compute-all-deps" {:upvalue-count 0 :arity 1 :constants ("for-each" {:upvalue-count 1 :arity 1 :constants ("env-get" "=" "type-of" "component" "island" "component-set-deps!" "transitive-deps") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 1 3 0 52 1 0 2 6 34 14 0 5 16 1 52 2 0 1 1 4 0 52 1 0 2 33 19 0 20 5 0 16 1 20 6 0 16 0 18 0 48 2 49 2 32 1 0 2 50)} "env-components") :bytecode (51 1 0 1 0 20 2 0 16 0 48 1 52 0 0 2 50)} "scan-components-from-source" {:upvalue-count 0 :arity 1 :constants ("regex-find-all" "\\(~([a-zA-Z_][a-zA-Z0-9_\\-:/]*)" "map" {:upvalue-count 0 :arity 1 :constants ("str" "~") :bytecode (1 1 0 16 0 52 0 0 2 50)}) :bytecode (20 0 0 1 1 0 16 0 48 2 17 1 51 3 0 16 1 52 2 0 2 50)} "components-needed" {:upvalue-count 0 :arity 2 :constants ("scan-components-from-source" "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("not" "contains?" "append!" "env-get" "=" "type-of" "component" "empty?" "component-deps" "transitive-deps" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)}) :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 5 18 1 16 0 52 3 0 2 17 1 16 1 52 5 0 1 1 6 0 52 4 0 2 6 33 16 0 5 20 8 0 16 1 48 1 52 7 0 1 52 0 0 1 33 10 0 20 8 0 16 1 48 1 32 9 0 20 9 0 16 0 18 1 48 2 17 2 51 11 0 0 0 16 2 52 10 0 2 50)}) :bytecode (20 0 0 16 0 48 1 17 2 52 1 0 0 17 3 51 3 0 1 3 1 1 16 2 52 2 0 2 5 16 3 50)} "page-component-bundle" {:upvalue-count 0 :arity 2 :constants ("components-needed") :bytecode (20 0 0 16 0 16 1 49 2 50)} "page-css-classes" {:upvalue-count 0 :arity 2 :constants ("components-needed" "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("env-get" "=" "type-of" "component" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "component-css-classes") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 1 3 0 52 1 0 2 33 19 0 51 5 0 0 1 20 6 0 16 1 48 1 52 4 0 2 32 1 0 2 50)} {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "scan-css-classes") :bytecode (20 0 0 16 0 16 1 48 2 17 2 52 1 0 0 17 3 51 3 0 1 1 1 3 16 2 52 2 0 2 5 51 4 0 1 3 20 5 0 16 0 48 1 52 2 0 2 5 16 3 50)} "scan-io-refs-walk" {:upvalue-count 0 :arity 3 :constants ("type-of" "symbol" "=" "symbol-name" "contains?" "not" "append!" "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("scan-io-refs-walk") :bytecode (20 0 0 16 0 18 0 18 1 49 3 50)} "dict" {:upvalue-count 3 :arity 1 :constants ("scan-io-refs-walk" "dict-get") :bytecode (20 0 0 18 0 16 0 52 1 0 2 18 1 18 2 49 3 50)} "keys") :bytecode (16 0 52 0 0 1 6 1 1 0 52 2 0 2 33 54 0 5 16 0 52 3 0 1 17 3 16 1 16 3 52 4 0 2 33 30 0 16 2 16 3 52 4 0 2 52 5 0 1 33 11 0 16 2 16 3 52 6 0 2 32 1 0 2 32 1 0 2 32 64 0 6 1 7 0 52 2 0 2 33 17 0 5 51 9 0 1 1 1 2 16 0 52 8 0 2 32 36 0 6 1 10 0 52 2 0 2 33 23 0 5 51 11 0 1 0 1 1 1 2 16 0 52 12 0 1 52 8 0 2 32 2 0 5 2 50)} "scan-io-refs" {:upvalue-count 0 :arity 2 :constants ("list" "scan-io-refs-walk") :bytecode (52 0 0 0 17 2 20 1 0 16 0 16 1 16 2 48 3 5 16 2 50)} "transitive-io-refs-walk" {:upvalue-count 0 :arity 5 :constants ("not" "contains?" "append!" "env-get" "=" "type-of" "component" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "scan-io-refs" "component-body" {:upvalue-count 4 :arity 1 :constants ("transitive-io-refs-walk") :bytecode (20 0 0 16 0 18 0 18 1 18 2 18 3 49 5 50)} "scan-refs" "macro" "macro-body") :bytecode (16 1 16 0 52 1 0 2 52 0 0 1 33 161 0 16 1 16 0 52 2 0 2 5 16 3 16 0 52 3 0 2 17 5 16 5 52 5 0 1 1 6 0 52 4 0 2 33 52 0 51 8 0 1 2 20 9 0 16 5 52 10 0 1 16 4 48 2 52 7 0 2 5 51 11 0 1 1 1 2 1 3 1 4 20 12 0 16 5 52 10 0 1 48 1 52 7 0 2 32 71 0 16 5 52 5 0 1 1 13 0 52 4 0 2 33 54 0 51 8 0 1 2 20 9 0 20 14 0 16 5 48 1 16 4 48 2 52 7 0 2 5 51 11 0 1 1 1 2 1 3 1 4 20 12 0 20 14 0 16 5 48 1 48 1 52 7 0 2 32 1 0 2 32 1 0 2 50)} "transitive-io-refs" {:upvalue-count 0 :arity 3 :constants ("list" "starts-with?" "~" "str" "transitive-io-refs-walk") :bytecode (52 0 0 0 17 3 52 0 0 0 17 4 16 0 1 2 0 52 1 0 2 33 5 0 16 0 32 9 0 1 2 0 16 0 52 3 0 2 17 5 20 4 0 16 5 16 4 16 3 16 1 16 2 48 5 5 16 3 50)} "compute-all-io-refs" {:upvalue-count 0 :arity 2 :constants ("for-each" {:upvalue-count 2 :arity 1 :constants ("env-get" "=" "type-of" "component" "component-set-io-refs!" "transitive-io-refs") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 1 3 0 52 1 0 2 33 21 0 20 4 0 16 1 20 5 0 16 0 18 0 18 1 48 3 49 2 32 1 0 2 50)} "env-components") :bytecode (51 1 0 1 0 1 1 20 2 0 16 0 48 1 52 0 0 2 50)} "component-io-refs-cached" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "env-get" "=" "type-of" "component" "not" "nil?" "component-io-refs" "empty?" "transitive-io-refs") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 16 1 16 3 52 3 0 2 17 4 16 4 52 5 0 1 1 6 0 52 4 0 2 6 33 36 0 5 20 9 0 16 4 48 1 52 8 0 1 52 7 0 1 6 33 16 0 5 20 9 0 16 4 48 1 52 10 0 1 52 7 0 1 33 10 0 20 9 0 16 4 49 1 32 11 0 20 11 0 16 0 16 1 16 2 49 3 50)} "component-pure?" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "env-has?" "env-get" "=" "type-of" "component" "not" "nil?" "component-io-refs" "empty?" "transitive-io-refs") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 16 1 16 3 52 3 0 2 33 11 0 16 1 16 3 52 4 0 2 32 1 0 2 17 4 16 4 52 6 0 1 1 7 0 52 5 0 2 6 33 36 0 5 20 10 0 16 4 48 1 52 9 0 1 52 8 0 1 6 33 16 0 5 20 10 0 16 4 48 1 52 11 0 1 52 8 0 1 33 4 0 4 32 15 0 20 12 0 16 0 16 1 16 2 48 3 52 11 0 1 50)} "render-target" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "env-has?" "env-get" "not" "=" "type-of" "component" "server" "component-affinity" "client" "component-pure?") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 16 1 16 3 52 3 0 2 33 11 0 16 1 16 3 52 4 0 2 32 1 0 2 17 4 16 4 52 7 0 1 1 8 0 52 6 0 2 52 5 0 1 33 6 0 1 9 0 32 71 0 16 4 52 10 0 1 17 5 16 5 1 9 0 52 6 0 2 33 6 0 1 9 0 32 45 0 16 5 1 11 0 52 6 0 2 33 6 0 1 11 0 32 27 0 20 12 0 16 0 16 1 16 2 48 3 52 5 0 1 33 6 0 1 9 0 32 3 0 1 11 0 50)} "page-render-plan" {:upvalue-count 0 :arity 3 :constants ("components-needed" "dict" "list" "for-each" {:upvalue-count 6 :arity 1 :constants ("render-target" "dict-set!" "=" "server" "append!" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "component-io-refs-cached") :bytecode (20 0 0 16 0 18 0 18 1 48 3 17 1 18 2 16 0 16 1 52 1 0 3 5 16 1 1 3 0 52 2 0 2 33 32 0 18 3 16 0 52 4 0 2 5 51 6 0 0 4 20 7 0 16 0 18 0 18 1 48 3 52 5 0 2 32 8 0 18 5 16 0 52 4 0 2 50)} "io-deps" "server" "components" "client") :bytecode (20 0 0 16 0 16 1 48 2 17 3 52 1 0 0 17 4 52 2 0 0 17 5 52 2 0 0 17 6 52 2 0 0 17 7 51 4 0 1 1 1 2 1 4 1 5 1 7 1 6 16 3 52 3 0 2 5 1 5 0 16 7 1 6 0 16 5 1 7 0 16 4 1 8 0 16 6 65 4 0 50)} "env-components" {:upvalue-count 0 :arity 1 :constants ("filter" {:upvalue-count 1 :arity 1 :constants ("env-get" "component?" "macro?") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 1 0 1 6 34 7 0 5 16 1 52 2 0 1 50)} "keys") :bytecode (51 1 0 1 0 16 0 52 2 0 1 52 0 0 2 50)} {:library (web deps) :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 1 38 0 112 50))) diff --git a/shared/static/wasm/sx/freeze.sx b/shared/static/wasm/sx/freeze.sx index 561e11f2..f224b414 100644 --- a/shared/static/wasm/sx/freeze.sx +++ b/shared/static/wasm/sx/freeze.sx @@ -21,7 +21,8 @@ ;; Registry of freeze scopes: name → list of {name signal} entries -(define-library (sx freeze) +(define-library + (sx freeze) (export freeze-registry freeze-signal @@ -33,82 +34,96 @@ freeze-to-sx thaw-from-sx) (begin - -(define freeze-registry (dict)) - -;; Register a signal in the current freeze scope -(define freeze-signal :effects [mutation] - (fn (name sig) - (let ((scope-name (context "sx-freeze-scope" nil))) - (when scope-name - (let ((entries (or (get freeze-registry scope-name) (list)))) - (append! entries (dict "name" name "signal" sig)) - (dict-set! freeze-registry scope-name entries)))))) - -;; Freeze scope delimiter — collects signals registered within body -(define freeze-scope :effects [mutation] - (fn (name body-fn) - (scope-push! "sx-freeze-scope" name) - ;; Initialize empty entry list for this scope - (dict-set! freeze-registry name (list)) - (cek-call body-fn nil) - (scope-pop! "sx-freeze-scope") - nil)) - -;; Freeze a named scope → SX dict of signal values -(define cek-freeze-scope :effects [] - (fn (name) - (let ((entries (or (get freeze-registry name) (list))) - (signals-dict (dict))) - (for-each (fn (entry) - (dict-set! signals-dict - (get entry "name") - (signal-value (get entry "signal")))) - entries) - (dict "name" name "signals" signals-dict)))) - -;; Freeze all scopes -(define cek-freeze-all :effects [] - (fn () - (map (fn (name) (cek-freeze-scope name)) - (keys freeze-registry)))) - -;; Thaw a named scope — restore signal values from frozen data -(define cek-thaw-scope :effects [mutation] - (fn (name frozen) - (let ((entries (or (get freeze-registry name) (list))) - (values (get frozen "signals"))) - (when values - (for-each (fn (entry) - (let ((sig-name (get entry "name")) - (sig (get entry "signal")) - (val (get values sig-name))) - (when (not (nil? val)) - (reset! sig val)))) - entries))))) - -;; Thaw all scopes from a list of frozen scope dicts -(define cek-thaw-all :effects [mutation] - (fn (frozen-list) - (for-each (fn (frozen) - (cek-thaw-scope (get frozen "name") frozen)) - frozen-list))) - -;; Serialize a frozen scope to SX text -(define freeze-to-sx :effects [] - (fn (name) - (sx-serialize (cek-freeze-scope name)))) - -;; Restore from SX text -(define thaw-from-sx :effects [mutation] - (fn (sx-text) - (let ((parsed (sx-parse sx-text))) - (when (not (empty? parsed)) - (let ((frozen (first parsed))) - (cek-thaw-scope (get frozen "name") frozen)))))) - - -)) ;; end define-library + (define freeze-registry (dict)) + (define + freeze-signal + :effects (mutation) + (fn + (name sig) + (let + ((scope-name (context "sx-freeze-scope" nil))) + (when + scope-name + (let + ((entries (or (get freeze-registry scope-name) (list)))) + (append! entries (dict "name" name "signal" sig)) + (dict-set! freeze-registry scope-name entries)))))) + (define + freeze-scope + :effects (mutation) + (fn + (name body-fn) + (scope-push! "sx-freeze-scope" name) + (dict-set! freeze-registry name (list)) + (cek-call body-fn nil) + (scope-pop! "sx-freeze-scope") + nil)) + (define + cek-freeze-scope + :effects () + (fn + (name) + (let + ((entries (or (get freeze-registry name) (list))) + (signals-dict (dict))) + (for-each + (fn + (entry) + (dict-set! + signals-dict + (get entry "name") + (signal-value (get entry "signal")))) + entries) + (dict "name" name "signals" signals-dict)))) + (define + cek-freeze-all + :effects () + (fn + () + (map (fn (name) (cek-freeze-scope name)) (keys freeze-registry)))) + (define + cek-thaw-scope + :effects (mutation) + (fn + (name frozen) + (let + ((entries (or (get freeze-registry name) (list))) + (values (get frozen "signals"))) + (when + values + (for-each + (fn + (entry) + (let + ((sig-name (get entry "name")) + (sig (get entry "signal")) + (val (get values sig-name))) + (when (not (nil? val)) (reset! sig val)))) + entries))))) + (define + cek-thaw-all + :effects (mutation) + (fn + (frozen-list) + (for-each + (fn (frozen) (cek-thaw-scope (get frozen "name") frozen)) + frozen-list))) + (define + freeze-to-sx + :effects () + (fn (name) (sx-serialize (cek-freeze-scope name)))) + (define + thaw-from-sx + :effects (mutation) + (fn + (sx-text) + (let + ((parsed (sx-parse sx-text))) + (when + (not (empty? parsed)) + (let + ((frozen (first parsed))) + (cek-thaw-scope (get frozen "name") frozen)))))))) ;; end define-library ;; Re-export to global namespace for backward compatibility (import (sx freeze)) diff --git a/shared/static/wasm/sx/freeze.sxbc b/shared/static/wasm/sx/freeze.sxbc index b236b3a5..046dabc3 100644 --- a/shared/static/wasm/sx/freeze.sxbc +++ b/shared/static/wasm/sx/freeze.sxbc @@ -1,3 +1,3 @@ -(sxbc 1 "320fb4826d09fed3" +(sxbc 1 "050ab6181dc93341" (code :constants ("freeze-registry" "dict" "freeze-signal" {:upvalue-count 0 :arity 2 :constants ("context" "sx-freeze-scope" "get" "freeze-registry" "list" "append!" "dict" "name" "signal" "dict-set!") :bytecode (1 1 0 2 52 0 0 2 17 2 16 2 33 55 0 20 3 0 16 2 52 2 0 2 6 34 5 0 5 52 4 0 0 17 3 16 3 1 7 0 16 0 1 8 0 16 1 52 6 0 4 52 5 0 2 5 20 3 0 16 2 16 3 52 9 0 3 32 1 0 2 50)} "freeze-scope" {:upvalue-count 0 :arity 2 :constants ("scope-push!" "sx-freeze-scope" "dict-set!" "freeze-registry" "list" "cek-call" "scope-pop!") :bytecode (1 1 0 16 0 52 0 0 2 5 20 3 0 16 0 52 4 0 0 52 2 0 3 5 16 1 2 52 5 0 2 5 1 1 0 52 6 0 1 5 2 50)} "cek-freeze-scope" {:upvalue-count 0 :arity 1 :constants ("get" "freeze-registry" "list" "dict" "for-each" {:upvalue-count 1 :arity 1 :constants ("dict-set!" "get" "name" "signal-value" "signal") :bytecode (18 0 16 0 1 2 0 52 1 0 2 20 3 0 16 0 1 4 0 52 1 0 2 48 1 52 0 0 3 50)} "name" "signals") :bytecode (20 1 0 16 0 52 0 0 2 6 34 5 0 5 52 2 0 0 17 1 52 3 0 0 17 2 51 5 0 1 2 16 1 52 4 0 2 5 1 6 0 16 0 1 7 0 16 2 52 3 0 4 50)} "cek-freeze-all" {:upvalue-count 0 :arity 0 :constants ("map" {:upvalue-count 0 :arity 1 :constants ("cek-freeze-scope") :bytecode (20 0 0 16 0 49 1 50)} "keys" "freeze-registry") :bytecode (51 1 0 20 3 0 52 2 0 1 52 0 0 2 50)} "cek-thaw-scope" {:upvalue-count 0 :arity 2 :constants ("get" "freeze-registry" "list" "signals" "for-each" {:upvalue-count 1 :arity 1 :constants ("get" "name" "signal" "not" "nil?" "reset!") :bytecode (16 0 1 1 0 52 0 0 2 17 1 16 0 1 2 0 52 0 0 2 17 2 18 0 16 1 52 0 0 2 17 3 16 3 52 4 0 1 52 3 0 1 33 12 0 20 5 0 16 2 16 3 49 2 32 1 0 2 50)}) :bytecode (20 1 0 16 0 52 0 0 2 6 34 5 0 5 52 2 0 0 17 2 16 1 1 3 0 52 0 0 2 17 3 16 3 33 14 0 51 5 0 1 3 16 2 52 4 0 2 32 1 0 2 50)} "cek-thaw-all" {:upvalue-count 0 :arity 1 :constants ("for-each" {:upvalue-count 0 :arity 1 :constants ("cek-thaw-scope" "get" "name") :bytecode (20 0 0 16 0 1 2 0 52 1 0 2 16 0 49 2 50)}) :bytecode (51 1 0 16 0 52 0 0 2 50)} "freeze-to-sx" {:upvalue-count 0 :arity 1 :constants ("sx-serialize" "cek-freeze-scope") :bytecode (20 1 0 16 0 48 1 52 0 0 1 50)} "thaw-from-sx" {:upvalue-count 0 :arity 1 :constants ("sx-parse" "not" "empty?" "first" "cek-thaw-scope" "get" "name") :bytecode (20 0 0 16 0 48 1 17 1 16 1 52 2 0 1 52 1 0 1 33 27 0 16 1 52 3 0 1 17 2 20 4 0 16 2 1 6 0 52 5 0 2 16 2 49 2 32 1 0 2 50)} {:library (sx freeze) :op "import"}) :bytecode (52 1 0 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 1 18 0 112 50))) diff --git a/shared/static/wasm/sx/vm.sx b/shared/static/wasm/sx/vm.sx index 6e0224a6..fbd63557 100644 --- a/shared/static/wasm/sx/vm.sx +++ b/shared/static/wasm/sx/vm.sx @@ -79,35 +79,35 @@ (fn (vm value) (let - ((sp (get vm "sp")) (stack (get vm "stack"))) + ((sp (vm-sp vm)) (stack (vm-stack vm))) (when (>= sp (vm-stack-length stack)) (let - ((new-stack (make-vm-stack (* sp 2)))) + ((new-stack (vm-stack-grow stack sp))) (vm-stack-copy! stack new-stack sp) - (dict-set! vm "stack" new-stack) + (vm-set-stack! vm new-stack) (set! stack new-stack))) (vm-stack-set! stack sp value) - (dict-set! vm "sp" (+ sp 1))))) + (vm-set-sp! vm (+ sp 1))))) (define vm-pop (fn (vm) (let - ((sp (- (get vm "sp") 1))) - (dict-set! vm "sp" sp) - (vm-stack-get (get vm "stack") sp)))) + ((sp (- (vm-sp vm) 1))) + (vm-set-sp! vm sp) + (vm-stack-get (vm-stack vm) sp)))) (define vm-peek - (fn (vm) (vm-stack-get (get vm "stack") (- (get vm "sp") 1)))) + (fn (vm) (vm-stack-get (vm-stack vm) (- (vm-sp vm) 1)))) (define frame-read-u8 (fn (frame) (let - ((ip (get frame "ip")) - (bc (get (get (get frame "closure") "vm-code") "vc-bytecode"))) - (let ((v (nth bc ip))) (dict-set! frame "ip" (+ ip 1)) v)))) + ((ip (frame-ip frame)) + (bc (-> frame frame-closure closure-code code-bytecode))) + (let ((v (nth bc ip))) (frame-set-ip! frame (+ ip 1)) v)))) (define frame-read-u16 (fn @@ -206,31 +206,28 @@ (if (has-key? cells key) (uv-get (get cells key)) - (vm-stack-get (get vm "stack") (+ (get frame "base") slot)))))) + (vm-stack-get (vm-stack vm) (+ (frame-base frame) slot)))))) (define frame-local-set (fn (vm frame slot value) - "Write a local variable — to shared cell if captured, else to stack." + "Write a local variable — to shared cell or stack." (let ((cells (get frame "local-cells")) (key (str slot))) (if (has-key? cells key) (uv-set! (get cells key) value) - (vm-stack-set! - (get vm "stack") - (+ (get frame "base") slot) - value))))) + (vm-stack-set! (vm-stack vm) (+ (frame-base frame) slot) value))))) (define frame-upvalue-get (fn (frame idx) - (uv-get (nth (get (get frame "closure") "vm-upvalues") idx)))) + (uv-get (nth (-> frame frame-closure closure-upvalues) idx)))) (define frame-upvalue-set (fn (frame idx value) - (uv-set! (nth (get (get frame "closure") "vm-upvalues") idx) value))) + (uv-set! (nth (-> frame frame-closure closure-upvalues) idx) value))) (define frame-ip (fn (frame) (get frame "ip"))) (define frame-set-ip! (fn (frame val) (dict-set! frame "ip" val))) (define frame-base (fn (frame) (get frame "base"))) @@ -302,12 +299,12 @@ (vm frame name) "Look up a global: globals table → closure env → primitives → HO wrappers" (let - ((globals (get vm "globals"))) + ((globals (vm-globals-ref vm))) (if (has-key? globals name) (get globals name) (let - ((closure-env (get (get frame "closure") "closure-env"))) + ((closure-env (-> frame frame-closure closure-env))) (if (nil? closure-env) (cek-try @@ -325,41 +322,42 @@ vm-resolve-ho-form (fn (vm name) - (cond - (= name "for-each") - (fn - (f coll) - (for-each (fn (x) (vm-call-external vm f (list x))) coll)) - (= name "map") - (fn - (f coll) - (map (fn (x) (vm-call-external vm f (list x))) coll)) - (= name "map-indexed") - (fn - (f coll) - (map-indexed - (fn (i x) (vm-call-external vm f (list i x))) - coll)) - (= name "filter") - (fn - (f coll) - (filter (fn (x) (vm-call-external vm f (list x))) coll)) - (= name "reduce") - (fn - (f init coll) - (reduce - (fn (acc x) (vm-call-external vm f (list acc x))) - init - coll)) - (= name "some") - (fn - (f coll) - (some (fn (x) (vm-call-external vm f (list x))) coll)) - (= name "every?") - (fn - (f coll) - (every? (fn (x) (vm-call-external vm f (list x))) coll)) - :else (error (str "VM undefined: " name))))) + (match + name + ("for-each" + (fn + (f coll) + (for-each (fn (x) (vm-call-external vm f (list x))) coll))) + ("map" + (fn + (f coll) + (map (fn (x) (vm-call-external vm f (list x))) coll))) + ("map-indexed" + (fn + (f coll) + (map-indexed + (fn (i x) (vm-call-external vm f (list i x))) + coll))) + ("filter" + (fn + (f coll) + (filter (fn (x) (vm-call-external vm f (list x))) coll))) + ("reduce" + (fn + (f init coll) + (reduce + (fn (acc x) (vm-call-external vm f (list acc x))) + init + coll))) + ("some" + (fn + (f coll) + (some (fn (x) (vm-call-external vm f (list x))) coll))) + ("every?" + (fn + (f coll) + (every? (fn (x) (vm-call-external vm f (list x))) coll))) + (_ (error (str "VM undefined: " name)))))) (define vm-call-external (fn @@ -372,14 +370,14 @@ vm-global-set (fn (vm frame name value) - "Set a global: write to closure env if name exists there, else globals." + "Set a global: write to closure env if found, else globals table." (let - ((closure-env (get (get frame "closure") "vm-closure-env")) + ((closure-env (get (frame-closure frame) "vm-closure-env")) (written false)) (when (not (nil? closure-env)) (set! written (env-walk-set! closure-env name value))) - (when (not written) (dict-set! (get vm "globals") name value))))) + (when (not written) (dict-set! (vm-globals-ref vm) name value))))) (define env-walk (fn @@ -414,20 +412,15 @@ (let ((code (code-from-value code-val)) (uv-count - (if - (dict? code-val) - (let - ((n (get code-val "upvalue-count"))) - (if (nil? n) 0 n)) - 0))) + (if (dict? code-val) (or (get code-val "upvalue-count") 0) 0))) (let - ((upvalues (let ((result (list)) (i 0)) (define capture-loop (fn () (when (< i uv-count) (let ((is-local (frame-read-u8 frame)) (index (frame-read-u8 frame))) (let ((cell (if (= is-local 1) (let ((cells (get frame "local-cells")) (key (str index))) (if (has-key? cells key) (get cells key) (let ((c (make-upvalue-cell (vm-stack-get (get vm "stack") (+ (get frame "base") index))))) (dict-set! cells key c) c))) (nth (get (get frame "closure") "vm-upvalues") index)))) (append! result cell) (set! i (+ i 1)) (capture-loop)))))) (capture-loop) result))) - (make-vm-closure code upvalues nil (get vm "globals") nil))))) + ((upvalues (let ((result (list)) (i 0)) (define capture-loop (fn () (when (< i uv-count) (let ((is-local (frame-read-u8 frame)) (index (frame-read-u8 frame))) (let ((cell (if (= is-local 1) (let ((cells (get frame "local-cells")) (key (str index))) (if (has-key? cells key) (get cells key) (let ((c (make-upvalue-cell (vm-stack-get (vm-stack vm) (+ (frame-base frame) index))))) (dict-set! cells key c) c))) (nth (-> frame frame-closure closure-upvalues) index)))) (append! result cell) (set! i (+ i 1)) (capture-loop)))))) (capture-loop) result))) + (make-vm-closure code upvalues nil (vm-globals-ref vm) nil))))) (define vm-run (fn (vm) - "Execute bytecode until all frames are consumed." + "Execute bytecode until all frames are done or IO suspension." (define loop (fn @@ -438,9 +431,9 @@ ((frame (first (vm-frames vm))) (rest-frames (rest (vm-frames vm)))) (let - ((bc (code-bytecode (closure-code (frame-closure frame)))) + ((bc (-> frame frame-closure closure-code code-bytecode)) (consts - (code-constants (closure-code (frame-closure frame))))) + (-> frame frame-closure closure-code code-constants))) (if (>= (frame-ip frame) (len bc)) (vm-set-frames! vm (list)) diff --git a/shared/static/wasm/sx/vm.sxbc b/shared/static/wasm/sx/vm.sxbc index 4e1e45cc..87ea1e1b 100644 --- a/shared/static/wasm/sx/vm.sxbc +++ b/shared/static/wasm/sx/vm.sxbc @@ -1,3 +1,3 @@ -(sxbc 1 "2e4b30ff13331736" +(sxbc 1 "c505d7ccc8fddedf" (code - :constants ("make-upvalue-cell" {:upvalue-count 0 :arity 1 :constants ("uv-value") :bytecode (1 0 0 16 0 65 1 0 50)} "uv-get" {:upvalue-count 0 :arity 1 :constants ("get" "uv-value") :bytecode (16 0 1 1 0 52 0 0 2 50)} "uv-set!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "uv-value") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "make-vm-code" {:upvalue-count 0 :arity 4 :constants ("vc-bytecode" "vc-locals" "vc-arity" "vc-constants") :bytecode (1 0 0 16 2 1 1 0 16 1 1 2 0 16 0 1 3 0 16 3 65 4 0 50)} "make-vm-closure" {:upvalue-count 0 :arity 5 :constants ("vm-globals" "vm-upvalues" "vm-name" "vm-code" "vm-closure-env") :bytecode (1 0 0 16 3 1 1 0 16 1 1 2 0 16 2 1 3 0 16 0 1 4 0 16 4 65 5 0 50)} "make-vm-frame" {:upvalue-count 0 :arity 2 :constants ("ip" 0 "closure" "base" "local-cells") :bytecode (1 0 0 1 1 0 1 2 0 16 0 1 3 0 16 1 1 4 0 65 0 0 65 4 0 50)} "make-vm" {:upvalue-count 0 :arity 1 :constants ("sp" 0 "frames" "list" "stack" "make-vm-stack" 4096 "globals") :bytecode (1 0 0 1 1 0 1 2 0 52 3 0 0 1 4 0 1 6 0 52 5 0 1 1 7 0 16 0 65 4 0 50)} "vm-push" {:upvalue-count 0 :arity 2 :constants ("get" "sp" "stack" ">=" "vm-stack-length" "make-vm-stack" "*" 2 "vm-stack-copy!" "dict-set!" "vm-stack-set!" "+" 1) :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 0 1 2 0 52 0 0 2 17 3 16 2 16 3 52 4 0 1 52 3 0 2 33 45 0 16 2 1 7 0 52 6 0 2 52 5 0 1 17 4 16 3 16 4 16 2 52 8 0 3 5 16 0 1 2 0 16 4 52 9 0 3 5 16 4 17 3 32 1 0 2 5 16 3 16 2 16 1 52 10 0 3 5 16 0 1 1 0 16 2 1 12 0 52 11 0 2 52 9 0 3 50)} "vm-pop" {:upvalue-count 0 :arity 1 :constants ("-" "get" "sp" 1 "dict-set!" "vm-stack-get" "stack") :bytecode (16 0 1 2 0 52 1 0 2 1 3 0 52 0 0 2 17 1 16 0 1 2 0 16 1 52 4 0 3 5 16 0 1 6 0 52 1 0 2 16 1 52 5 0 2 50)} "vm-peek" {:upvalue-count 0 :arity 1 :constants ("vm-stack-get" "get" "stack" "-" "sp" 1) :bytecode (16 0 1 2 0 52 1 0 2 16 0 1 4 0 52 1 0 2 1 5 0 52 3 0 2 52 0 0 2 50)} "frame-read-u8" {:upvalue-count 0 :arity 1 :constants ("get" "ip" "closure" "vm-code" "vc-bytecode" "nth" "dict-set!" "+" 1) :bytecode (16 0 1 1 0 52 0 0 2 17 1 16 0 1 2 0 52 0 0 2 1 3 0 52 0 0 2 1 4 0 52 0 0 2 17 2 16 2 16 1 52 5 0 2 17 3 16 0 1 1 0 16 1 1 8 0 52 7 0 2 52 6 0 3 5 16 3 50)} "frame-read-u16" {:upvalue-count 0 :arity 1 :constants ("frame-read-u8" "+" "*" 256) :bytecode (20 0 0 16 0 48 1 17 1 20 0 0 16 0 48 1 17 2 16 1 16 2 1 3 0 52 2 0 2 52 1 0 2 50)} "frame-read-i16" {:upvalue-count 0 :arity 1 :constants ("frame-read-u16" ">=" 32768 "-" 65536) :bytecode (20 0 0 16 0 48 1 17 1 16 1 1 2 0 52 1 0 2 33 12 0 16 1 1 4 0 52 3 0 2 32 2 0 16 1 50)} "vm-push-frame" {:upvalue-count 0 :arity 3 :constants ("make-vm-frame" "vm-sp" "for-each" {:upvalue-count 1 :arity 1 :constants ("vm-push") :bytecode (20 0 0 18 0 16 0 49 2 50)} "pad-n-nils" "-" "code-locals" "closure-code" "len" "vm-set-frames!" "cons" "vm-frames") :bytecode (20 0 0 16 1 20 1 0 16 0 48 1 48 2 17 3 51 3 0 1 0 16 2 52 2 0 2 5 20 4 0 16 0 20 6 0 20 7 0 16 1 48 1 48 1 16 2 52 8 0 1 52 5 0 2 48 2 5 20 9 0 16 0 16 3 20 11 0 16 0 48 1 52 10 0 2 49 2 50)} "code-from-value" {:upvalue-count 0 :arity 1 :constants ("Convert a compiler output dict to a vm-code object." "not" "dict?" "make-vm-code" 0 16 "list" "get" "bytecode" "nil?" "constants" "arity" "+") :bytecode (1 0 0 5 16 0 52 2 0 1 52 1 0 1 33 22 0 20 3 0 1 4 0 1 5 0 52 6 0 0 52 6 0 0 49 4 32 112 0 16 0 1 8 0 52 7 0 2 17 1 16 1 52 9 0 1 33 7 0 52 6 0 0 32 2 0 16 1 17 2 16 0 1 10 0 52 7 0 2 17 3 16 3 52 9 0 1 33 7 0 52 6 0 0 32 2 0 16 3 17 4 16 0 1 11 0 52 7 0 2 17 5 16 5 52 9 0 1 33 6 0 1 4 0 32 2 0 16 5 17 6 20 3 0 16 6 16 6 1 5 0 52 12 0 2 16 2 16 4 49 4 50)} "vm-closure?" {:upvalue-count 0 :arity 1 :constants ("dict?" "has-key?" "vm-code") :bytecode (16 0 52 0 0 1 6 33 10 0 5 16 0 1 2 0 52 1 0 2 50)} "*active-vm*" "*jit-compile-fn*" "lambda?" {:upvalue-count 0 :arity 1 :constants ("=" "type-of" "lambda") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 50)} "lambda-compiled" {:upvalue-count 0 :arity 1 :constants () :bytecode (2 50)} "lambda-set-compiled!" {:upvalue-count 0 :arity 2 :constants () :bytecode (2 50)} "lambda-name" "cek-call-or-suspend" {:upvalue-count 0 :arity 3 :constants ("cek-call") :bytecode (16 1 16 2 52 0 0 2 50)} "try-jit-call" {:upvalue-count 0 :arity 3 :constants ("lambda-compiled" "vm-closure?" "vm-push" "vm-call-closure" "vm-globals-ref" "=" "jit-failed" "cek-call-or-suspend" "*jit-compile-fn*" "lambda-name" "lambda-set-compiled!") :bytecode (20 0 0 16 1 48 1 17 3 20 1 0 16 3 48 1 33 26 0 20 2 0 16 0 20 3 0 16 3 16 2 20 4 0 16 0 48 1 48 3 49 2 32 163 0 16 3 1 6 0 52 5 0 2 33 21 0 20 2 0 16 0 20 7 0 16 0 16 1 16 2 48 3 49 2 32 130 0 20 8 0 6 33 8 0 5 20 9 0 16 1 48 1 33 94 0 20 10 0 16 1 1 6 0 48 2 5 20 8 0 16 1 20 4 0 16 0 48 1 48 2 17 4 20 1 0 16 4 48 1 33 36 0 20 10 0 16 1 16 4 48 2 5 20 2 0 16 0 20 3 0 16 4 16 2 20 4 0 16 0 48 1 48 3 49 2 32 18 0 20 2 0 16 0 20 7 0 16 0 16 1 16 2 48 3 49 2 32 18 0 20 2 0 16 0 20 7 0 16 0 16 1 16 2 48 3 49 2 50)} "vm-call" {:upvalue-count 0 :arity 3 :constants ("vm-closure?" "vm-push-frame" "lambda?" "try-jit-call" "=" "type-of" "component" "island" "vm-push" "cek-call-or-suspend" "callable?" "apply" "error" "str" "VM: not callable: ") :bytecode (20 0 0 16 1 48 1 33 14 0 20 1 0 16 0 16 1 16 2 49 3 32 123 0 16 1 52 2 0 1 33 14 0 20 3 0 16 0 16 1 16 2 49 3 32 100 0 16 1 52 5 0 1 1 6 0 52 4 0 2 6 34 14 0 5 16 1 52 5 0 1 1 7 0 52 4 0 2 33 21 0 20 8 0 16 0 20 9 0 16 0 16 1 16 2 48 3 49 2 32 45 0 20 10 0 16 1 48 1 33 18 0 20 8 0 16 0 16 1 16 2 52 11 0 2 49 2 32 17 0 1 14 0 16 1 52 5 0 1 52 13 0 2 52 12 0 1 50)} "frame-local-get" {:upvalue-count 0 :arity 3 :constants ("Read a local variable — check shared cells first, then stack." "get" "local-cells" "str" "has-key?" "uv-get" "vm-stack-get" "stack" "+" "base") :bytecode (1 0 0 5 16 1 1 2 0 52 1 0 2 17 3 16 2 52 3 0 1 17 4 16 3 16 4 52 4 0 2 33 16 0 20 5 0 16 3 16 4 52 1 0 2 49 1 32 28 0 16 0 1 7 0 52 1 0 2 16 1 1 9 0 52 1 0 2 16 2 52 8 0 2 52 6 0 2 50)} "frame-local-set" {:upvalue-count 0 :arity 4 :constants ("Write a local variable — to shared cell if captured, else to stack." "get" "local-cells" "str" "has-key?" "uv-set!" "vm-stack-set!" "stack" "+" "base") :bytecode (1 0 0 5 16 1 1 2 0 52 1 0 2 17 4 16 2 52 3 0 1 17 5 16 4 16 5 52 4 0 2 33 18 0 20 5 0 16 4 16 5 52 1 0 2 16 3 49 2 32 30 0 16 0 1 7 0 52 1 0 2 16 1 1 9 0 52 1 0 2 16 2 52 8 0 2 16 3 52 6 0 3 50)} "frame-upvalue-get" {:upvalue-count 0 :arity 2 :constants ("uv-get" "nth" "get" "closure" "vm-upvalues") :bytecode (20 0 0 16 0 1 3 0 52 2 0 2 1 4 0 52 2 0 2 16 1 52 1 0 2 49 1 50)} "frame-upvalue-set" {:upvalue-count 0 :arity 3 :constants ("uv-set!" "nth" "get" "closure" "vm-upvalues") :bytecode (20 0 0 16 0 1 3 0 52 2 0 2 1 4 0 52 2 0 2 16 1 52 1 0 2 16 2 49 2 50)} "frame-ip" {:upvalue-count 0 :arity 1 :constants ("get" "ip") :bytecode (16 0 1 1 0 52 0 0 2 50)} "frame-set-ip!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "ip") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "frame-base" {:upvalue-count 0 :arity 1 :constants ("get" "base") :bytecode (16 0 1 1 0 52 0 0 2 50)} "frame-closure" {:upvalue-count 0 :arity 1 :constants ("get" "closure") :bytecode (16 0 1 1 0 52 0 0 2 50)} "closure-code" {:upvalue-count 0 :arity 1 :constants ("get" "vm-code") :bytecode (16 0 1 1 0 52 0 0 2 50)} "closure-upvalues" {:upvalue-count 0 :arity 1 :constants ("get" "vm-upvalues") :bytecode (16 0 1 1 0 52 0 0 2 50)} "closure-env" {:upvalue-count 0 :arity 1 :constants ("get" "closure-env") :bytecode (16 0 1 1 0 52 0 0 2 50)} "code-bytecode" {:upvalue-count 0 :arity 1 :constants ("get" "vc-bytecode") :bytecode (16 0 1 1 0 52 0 0 2 50)} "code-constants" {:upvalue-count 0 :arity 1 :constants ("get" "vc-constants") :bytecode (16 0 1 1 0 52 0 0 2 50)} "code-locals" {:upvalue-count 0 :arity 1 :constants ("get" "vc-locals") :bytecode (16 0 1 1 0 52 0 0 2 50)} "vm-sp" {:upvalue-count 0 :arity 1 :constants ("get" "sp") :bytecode (16 0 1 1 0 52 0 0 2 50)} "vm-set-sp!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "sp") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "vm-stack" {:upvalue-count 0 :arity 1 :constants ("get" "stack") :bytecode (16 0 1 1 0 52 0 0 2 50)} "vm-set-stack!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "stack") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "vm-frames" {:upvalue-count 0 :arity 1 :constants ("get" "frames") :bytecode (16 0 1 1 0 52 0 0 2 50)} "vm-set-frames!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "frames") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "vm-globals-ref" {:upvalue-count 0 :arity 1 :constants ("get" "globals") :bytecode (16 0 1 1 0 52 0 0 2 50)} "collect-n-from-stack" {:upvalue-count 0 :arity 2 :constants ("list" 0 {:upvalue-count 5 :arity 0 :constants ("<" "cons" "vm-pop" "+" 1) :bytecode (18 0 18 1 52 0 0 2 33 35 0 20 2 0 18 3 48 1 18 2 52 1 0 2 19 2 5 18 0 1 4 0 52 3 0 2 19 0 5 18 4 49 0 32 1 0 2 50)}) :bytecode (52 0 0 0 17 2 1 1 0 17 3 51 2 0 1 3 1 1 1 2 1 0 1 4 17 4 5 16 4 48 0 5 16 2 50)} "pad-n-nils" {:upvalue-count 0 :arity 2 :constants (0 {:upvalue-count 4 :arity 0 :constants ("<" "vm-push" "+" 1) :bytecode (18 0 18 1 52 0 0 2 33 28 0 20 1 0 18 2 2 48 2 5 18 0 1 3 0 52 2 0 2 19 0 5 18 3 49 0 32 1 0 2 50)}) :bytecode (1 0 0 17 2 51 1 0 1 2 1 1 1 0 1 3 17 3 5 16 3 49 0 50)} "collect-n-pairs" {:upvalue-count 0 :arity 2 :constants (0 {:upvalue-count 5 :arity 0 :constants ("<" "vm-pop" "dict-set!" "+" 1) :bytecode (18 0 18 1 52 0 0 2 33 48 0 20 1 0 18 2 48 1 17 0 20 1 0 18 2 48 1 17 1 18 3 16 1 16 0 52 2 0 3 5 18 0 1 4 0 52 3 0 2 19 0 5 18 4 49 0 32 1 0 2 50)}) :bytecode (65 0 0 17 2 1 0 0 17 3 51 1 0 1 3 1 1 1 0 1 2 1 4 17 4 5 16 4 48 0 5 16 2 50)} "vm-global-get" {:upvalue-count 0 :arity 3 :constants ("Look up a global: globals table → closure env → primitives → HO wrappers" "get" "globals" "has-key?" "closure" "closure-env" "nil?" "cek-try" {:upvalue-count 1 :arity 0 :constants ("get-primitive") :bytecode (18 0 52 0 0 1 50)} {:upvalue-count 2 :arity 1 :constants ("vm-resolve-ho-form") :bytecode (20 0 0 18 0 18 1 49 2 50)} "env-walk") :bytecode (1 0 0 5 16 0 1 2 0 52 1 0 2 17 3 16 3 16 2 52 3 0 2 33 11 0 16 3 16 2 52 1 0 2 32 87 0 16 1 1 4 0 52 1 0 2 1 5 0 52 1 0 2 17 4 16 4 52 6 0 1 33 19 0 51 8 0 1 2 51 9 0 1 0 1 2 52 7 0 2 32 41 0 20 10 0 16 4 16 2 48 2 17 5 16 5 52 6 0 1 33 19 0 51 8 0 1 2 51 9 0 1 0 1 2 52 7 0 2 32 2 0 16 5 50)} "vm-resolve-ho-form" {:upvalue-count 0 :arity 2 :constants ("=" "for-each" {:upvalue-count 1 :arity 2 :constants ("for-each" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "map" {:upvalue-count 1 :arity 2 :constants ("map" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "map-indexed" {:upvalue-count 1 :arity 2 :constants ("map-indexed" {:upvalue-count 2 :arity 2 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 16 1 52 1 0 2 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "filter" {:upvalue-count 1 :arity 2 :constants ("filter" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "reduce" {:upvalue-count 1 :arity 3 :constants ("reduce" {:upvalue-count 2 :arity 2 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 16 1 52 1 0 2 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 16 2 52 0 0 3 50)} "some" {:upvalue-count 1 :arity 2 :constants ("some" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "every?" {:upvalue-count 1 :arity 2 :constants ("every?" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "error" "str" "VM undefined: ") :bytecode (16 1 1 1 0 52 0 0 2 33 8 0 51 2 0 1 0 32 133 0 16 1 1 3 0 52 0 0 2 33 8 0 51 4 0 1 0 32 113 0 16 1 1 5 0 52 0 0 2 33 8 0 51 6 0 1 0 32 93 0 16 1 1 7 0 52 0 0 2 33 8 0 51 8 0 1 0 32 73 0 16 1 1 9 0 52 0 0 2 33 8 0 51 10 0 1 0 32 53 0 16 1 1 11 0 52 0 0 2 33 8 0 51 12 0 1 0 32 33 0 16 1 1 13 0 52 0 0 2 33 8 0 51 14 0 1 0 32 13 0 1 17 0 16 1 52 16 0 2 52 15 0 1 50)} "vm-call-external" {:upvalue-count 0 :arity 3 :constants ("vm-closure?" "vm-call-closure" "vm-globals-ref" "cek-call") :bytecode (20 0 0 16 1 48 1 33 19 0 20 1 0 16 1 16 2 20 2 0 16 0 48 1 49 3 32 8 0 16 1 16 2 52 3 0 2 50)} "vm-global-set" {:upvalue-count 0 :arity 4 :constants ("Set a global: write to closure env if name exists there, else globals." "get" "closure" "vm-closure-env" "not" "nil?" "env-walk-set!" "dict-set!" "globals") :bytecode (1 0 0 5 16 1 1 2 0 52 1 0 2 1 3 0 52 1 0 2 17 4 4 17 5 16 4 52 5 0 1 52 4 0 1 33 16 0 20 6 0 16 4 16 2 16 3 48 3 17 5 32 1 0 2 5 16 5 52 4 0 1 33 20 0 16 0 1 8 0 52 1 0 2 16 2 16 3 52 7 0 3 32 1 0 2 50)} "env-walk" {:upvalue-count 0 :arity 2 :constants ("nil?" "env-has?" "env-get" "env-parent" "env-walk") :bytecode (16 0 52 0 0 1 33 4 0 2 32 53 0 16 0 16 1 52 1 0 2 33 11 0 16 0 16 1 52 2 0 2 32 31 0 20 3 0 16 0 48 1 17 2 16 2 52 0 0 1 33 4 0 2 32 9 0 20 4 0 16 2 16 1 49 2 50)} "env-walk-set!" {:upvalue-count 0 :arity 3 :constants ("nil?" "env-has?" "env-set!" "env-parent" "env-walk-set!") :bytecode (16 0 52 0 0 1 33 4 0 4 32 59 0 16 0 16 1 52 1 0 2 33 15 0 16 0 16 1 16 2 52 2 0 3 5 3 32 33 0 20 3 0 16 0 48 1 17 3 16 3 52 0 0 1 33 4 0 4 32 11 0 20 4 0 16 3 16 1 16 2 49 3 50)} "vm-create-closure" {:upvalue-count 0 :arity 3 :constants ("Create a closure from a code constant. Reads upvalue descriptors\n from the bytecode stream and captures values from the enclosing frame." "code-from-value" "dict?" "get" "upvalue-count" "nil?" 0 "list" {:upvalue-count 6 :arity 0 :constants ("<" "frame-read-u8" "=" 1 "get" "local-cells" "str" "has-key?" "make-upvalue-cell" "vm-stack-get" "stack" "+" "base" "dict-set!" "nth" "closure" "vm-upvalues" "append!") :bytecode (18 0 18 1 52 0 0 2 33 174 0 20 1 0 18 2 48 1 17 0 20 1 0 18 2 48 1 17 1 16 0 1 3 0 52 2 0 2 33 92 0 18 2 1 5 0 52 4 0 2 17 3 16 1 52 6 0 1 17 4 16 3 16 4 52 7 0 2 33 11 0 16 3 16 4 52 4 0 2 32 48 0 20 8 0 18 3 1 10 0 52 4 0 2 18 2 1 12 0 52 4 0 2 16 1 52 11 0 2 52 9 0 2 48 1 17 5 16 3 16 4 16 5 52 13 0 3 5 16 5 32 22 0 18 2 1 15 0 52 4 0 2 1 16 0 52 4 0 2 16 1 52 14 0 2 17 2 18 4 16 2 52 17 0 2 5 18 0 1 3 0 52 11 0 2 19 0 5 18 5 49 0 32 1 0 2 50)} "make-vm-closure" "globals") :bytecode (1 0 0 5 20 1 0 16 2 48 1 17 3 16 2 52 2 0 1 33 31 0 16 2 1 4 0 52 3 0 2 17 5 16 5 52 5 0 1 33 6 0 1 6 0 32 2 0 16 5 32 3 0 1 6 0 17 4 52 7 0 0 17 6 1 6 0 17 7 51 8 0 1 7 1 4 1 1 1 0 1 6 1 8 17 8 5 16 8 48 0 5 16 6 17 5 20 9 0 16 3 16 5 2 16 0 1 10 0 52 3 0 2 2 49 5 50)} "vm-run" {:upvalue-count 0 :arity 2 :constants ("Execute bytecode until all frames are consumed." {:upvalue-count 2 :arity 0 :constants ("not" "empty?" "vm-frames" "first" "rest" "code-bytecode" "closure-code" "frame-closure" "code-constants" ">=" "frame-ip" "len" "vm-set-frames!" "list" "vm-step" "nil?" "get" "vm-globals-ref" "__io_request") :bytecode (20 2 0 18 0 48 1 52 1 0 1 52 0 0 1 33 146 0 20 2 0 18 0 48 1 52 3 0 1 17 0 20 2 0 18 0 48 1 52 4 0 1 17 1 20 5 0 20 6 0 20 7 0 16 0 48 1 48 1 48 1 17 2 20 8 0 20 6 0 20 7 0 16 0 48 1 48 1 48 1 17 3 20 10 0 16 0 48 1 16 2 52 11 0 1 52 9 0 2 33 14 0 20 12 0 18 0 52 13 0 0 49 2 32 45 0 20 14 0 18 0 16 0 16 1 16 2 16 3 48 5 5 20 17 0 18 0 48 1 1 18 0 52 16 0 2 52 15 0 1 33 7 0 18 1 49 0 32 1 0 2 32 1 0 2 50)}) :bytecode (1 0 0 5 51 1 0 1 0 1 1 17 1 5 16 1 49 0 50)} "vm-step" {:upvalue-count 0 :arity 5 :constants ("frame-read-u8" "=" 1 "frame-read-u16" "vm-push" "nth" 2 3 4 5 "vm-pop" 6 "vm-peek" 16 "frame-local-get" 17 "frame-local-set" 18 "frame-upvalue-get" 19 "frame-upvalue-set" 20 "vm-global-get" 21 "vm-global-set" 32 "frame-read-i16" "frame-set-ip!" "+" "frame-ip" 33 "not" 34 48 "collect-n-from-stack" "vm-call" 49 "vm-set-frames!" "vm-set-sp!" "frame-base" 50 51 "vm-create-closure" 52 "call-primitive" 64 65 "collect-n-pairs" 144 "apply" "str" 128 "dict-set!" "vm-globals-ref" 160 161 "-" 162 "*" 163 "/" 164 165 "<" 166 ">" 167 168 "len" 169 "first" 170 "rest" 171 172 "cons" 173 0 174 "inc" 175 "dec" 112 "__io_request" "error" "VM: unknown opcode ") :bytecode (20 0 0 16 1 48 1 17 5 16 5 1 2 0 52 1 0 2 33 27 0 20 3 0 16 1 48 1 17 6 20 4 0 16 0 16 4 16 6 52 5 0 2 49 2 32 254 6 16 5 1 6 0 52 1 0 2 33 11 0 20 4 0 16 0 2 49 2 32 231 6 16 5 1 7 0 52 1 0 2 33 11 0 20 4 0 16 0 3 49 2 32 208 6 16 5 1 8 0 52 1 0 2 33 11 0 20 4 0 16 0 4 49 2 32 185 6 16 5 1 9 0 52 1 0 2 33 10 0 20 10 0 16 0 49 1 32 163 6 16 5 1 11 0 52 1 0 2 33 17 0 20 4 0 16 0 20 12 0 16 0 48 1 49 2 32 134 6 16 5 1 13 0 52 1 0 2 33 30 0 20 0 0 16 1 48 1 17 6 20 4 0 16 0 20 14 0 16 0 16 1 16 6 48 3 49 2 32 92 6 16 5 1 15 0 52 1 0 2 33 30 0 20 0 0 16 1 48 1 17 6 20 16 0 16 0 16 1 16 6 20 12 0 16 0 48 1 49 4 32 50 6 16 5 1 17 0 52 1 0 2 33 28 0 20 0 0 16 1 48 1 17 6 20 4 0 16 0 20 18 0 16 1 16 6 48 2 49 2 32 10 6 16 5 1 19 0 52 1 0 2 33 28 0 20 0 0 16 1 48 1 17 6 20 20 0 16 1 16 6 20 12 0 16 0 48 1 49 3 32 226 5 16 5 1 21 0 52 1 0 2 33 40 0 20 3 0 16 1 48 1 17 6 16 4 16 6 52 5 0 2 17 7 20 4 0 16 0 20 22 0 16 0 16 1 16 7 48 3 49 2 32 174 5 16 5 1 23 0 52 1 0 2 33 40 0 20 3 0 16 1 48 1 17 6 16 4 16 6 52 5 0 2 17 7 20 24 0 16 0 16 1 16 7 20 12 0 16 0 48 1 49 4 32 122 5 16 5 1 25 0 52 1 0 2 33 32 0 20 26 0 16 1 48 1 17 6 20 27 0 16 1 20 29 0 16 1 48 1 16 6 52 28 0 2 49 2 32 78 5 16 5 1 30 0 52 1 0 2 33 54 0 20 26 0 16 1 48 1 17 6 20 10 0 16 0 48 1 17 7 16 7 52 31 0 1 33 23 0 20 27 0 16 1 20 29 0 16 1 48 1 16 6 52 28 0 2 49 2 32 1 0 2 32 12 5 16 5 1 32 0 52 1 0 2 33 50 0 20 26 0 16 1 48 1 17 6 20 10 0 16 0 48 1 17 7 16 7 33 23 0 20 27 0 16 1 20 29 0 16 1 48 1 16 6 52 28 0 2 49 2 32 1 0 2 32 206 4 16 5 1 33 0 52 1 0 2 33 43 0 20 0 0 16 1 48 1 17 6 20 34 0 16 0 16 6 48 2 17 7 20 10 0 16 0 48 1 17 8 20 35 0 16 0 16 8 16 7 49 3 32 151 4 16 5 1 36 0 52 1 0 2 33 68 0 20 0 0 16 1 48 1 17 6 20 34 0 16 0 16 6 48 2 17 7 20 10 0 16 0 48 1 17 8 20 37 0 16 0 16 2 48 2 5 20 38 0 16 0 20 39 0 16 1 48 1 48 2 5 20 35 0 16 0 16 8 16 7 49 3 32 71 4 16 5 1 40 0 52 1 0 2 33 46 0 20 10 0 16 0 48 1 17 6 20 37 0 16 0 16 2 48 2 5 20 38 0 16 0 20 39 0 16 1 48 1 48 2 5 20 4 0 16 0 16 6 49 2 32 13 4 16 5 1 41 0 52 1 0 2 33 44 0 20 3 0 16 1 48 1 17 6 16 4 16 6 52 5 0 2 17 7 20 42 0 16 0 16 1 16 7 48 3 17 8 20 4 0 16 0 16 8 49 2 32 213 3 16 5 1 43 0 52 1 0 2 33 57 0 20 3 0 16 1 48 1 17 6 20 0 0 16 1 48 1 17 7 16 4 16 6 52 5 0 2 17 8 20 34 0 16 0 16 7 48 2 17 9 20 4 0 16 0 16 8 16 9 52 44 0 2 49 2 32 144 3 16 5 1 45 0 52 1 0 2 33 32 0 20 3 0 16 1 48 1 17 6 20 34 0 16 0 16 6 48 2 17 7 20 4 0 16 0 16 7 49 2 32 100 3 16 5 1 46 0 52 1 0 2 33 32 0 20 3 0 16 1 48 1 17 6 20 47 0 16 0 16 6 48 2 17 7 20 4 0 16 0 16 7 49 2 32 56 3 16 5 1 48 0 52 1 0 2 33 39 0 20 0 0 16 1 48 1 17 6 20 34 0 16 0 16 6 48 2 17 7 20 4 0 16 0 20 50 0 16 7 52 49 0 2 49 2 32 5 3 16 5 1 51 0 52 1 0 2 33 42 0 20 3 0 16 1 48 1 17 6 16 4 16 6 52 5 0 2 17 7 20 53 0 16 0 48 1 16 7 20 12 0 16 0 48 1 52 52 0 3 32 207 2 16 5 1 54 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 28 0 2 49 2 32 159 2 16 5 1 55 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 56 0 2 49 2 32 111 2 16 5 1 57 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 58 0 2 49 2 32 63 2 16 5 1 59 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 60 0 2 49 2 32 15 2 16 5 1 61 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 1 0 2 49 2 32 223 1 16 5 1 62 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 63 0 2 49 2 32 175 1 16 5 1 64 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 65 0 2 49 2 32 127 1 16 5 1 66 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 31 0 1 49 2 32 94 1 16 5 1 67 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 68 0 1 49 2 32 61 1 16 5 1 69 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 70 0 1 49 2 32 28 1 16 5 1 71 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 72 0 1 49 2 32 251 0 16 5 1 73 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 5 0 2 49 2 32 203 0 16 5 1 74 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 75 0 2 49 2 32 155 0 16 5 1 76 0 52 1 0 2 33 24 0 20 4 0 16 0 1 77 0 20 10 0 16 0 48 1 52 56 0 2 49 2 32 119 0 16 5 1 78 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 79 0 1 49 2 32 86 0 16 5 1 80 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 81 0 1 49 2 32 53 0 16 5 1 82 0 52 1 0 2 33 28 0 20 10 0 16 0 48 1 17 6 20 53 0 16 0 48 1 1 83 0 16 6 52 52 0 3 32 13 0 1 85 0 16 5 52 50 0 2 52 84 0 1 50)} "vm-call-closure" {:upvalue-count 0 :arity 3 :constants ("*active-vm*" "make-vm" "vm-push-frame" "vm-run" "vm-pop") :bytecode (20 0 0 17 3 20 1 0 16 2 48 1 17 4 16 4 21 0 0 5 20 2 0 16 4 16 0 16 1 48 3 5 20 3 0 16 4 48 1 5 16 3 21 0 0 5 20 4 0 16 4 49 1 50)} "vm-execute-module" {:upvalue-count 0 :arity 2 :constants ("code-from-value" "make-vm" "make-vm-closure" "list" "module" "make-vm-frame" 0 "pad-n-nils" "code-locals" "vm-set-frames!" "vm-run" "get" "vm-globals-ref" "__io_request" "nil?" "vm-pop" "vm" "suspended" "op" "import" "request") :bytecode (20 0 0 16 0 48 1 17 2 20 1 0 16 1 48 1 17 3 20 2 0 16 2 52 3 0 0 1 4 0 16 1 2 48 5 17 4 20 5 0 16 4 1 6 0 48 2 17 5 20 7 0 16 3 20 8 0 16 2 48 1 48 2 5 20 9 0 16 3 16 5 52 3 0 1 48 2 5 20 10 0 16 3 48 1 5 20 12 0 16 3 48 1 1 13 0 52 11 0 2 17 6 16 6 52 14 0 1 33 10 0 20 15 0 16 3 49 1 32 23 0 1 16 0 16 3 1 17 0 3 1 18 0 1 19 0 1 20 0 16 6 65 4 0 50)} "vm-resume-module" {:upvalue-count 0 :arity 1 :constants ("Resume a suspended VM after IO (import) has been resolved.\n Clears __io_request in globals, pushes nil (import result), re-runs." "get" "vm" "dict-set!" "vm-globals-ref" "__io_request" "vm-push" "vm-run" "nil?" "vm-pop" "suspended" "op" "import" "request") :bytecode (1 0 0 5 16 0 1 2 0 52 1 0 2 17 1 20 4 0 16 1 48 1 1 5 0 2 52 3 0 3 5 20 6 0 16 1 2 48 2 5 20 7 0 16 1 48 1 5 20 4 0 16 1 48 1 1 5 0 52 1 0 2 17 2 16 2 52 8 0 1 33 10 0 20 9 0 16 1 49 1 32 23 0 1 2 0 16 1 1 10 0 3 1 11 0 1 12 0 1 13 0 16 2 65 4 0 50)} {:library (sx vm) :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 2 128 32 0 5 2 128 33 0 5 51 35 0 128 34 0 5 51 37 0 128 36 0 5 51 39 0 128 38 0 5 51 37 0 128 40 0 5 51 42 0 128 41 0 5 51 44 0 128 43 0 5 51 46 0 128 45 0 5 51 48 0 128 47 0 5 51 50 0 128 49 0 5 51 52 0 128 51 0 5 51 54 0 128 53 0 5 51 56 0 128 55 0 5 51 58 0 128 57 0 5 51 60 0 128 59 0 5 51 62 0 128 61 0 5 51 64 0 128 63 0 5 51 66 0 128 65 0 5 51 68 0 128 67 0 5 51 70 0 128 69 0 5 51 72 0 128 71 0 5 51 74 0 128 73 0 5 51 76 0 128 75 0 5 51 78 0 128 77 0 5 51 80 0 128 79 0 5 51 82 0 128 81 0 5 51 84 0 128 83 0 5 51 86 0 128 85 0 5 51 88 0 128 87 0 5 51 90 0 128 89 0 5 51 92 0 128 91 0 5 51 94 0 128 93 0 5 51 96 0 128 95 0 5 51 98 0 128 97 0 5 51 100 0 128 99 0 5 51 102 0 128 101 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 1 119 0 112 50))) + :constants ("make-upvalue-cell" {:upvalue-count 0 :arity 1 :constants ("uv-value") :bytecode (1 0 0 16 0 65 1 0 50)} "uv-get" {:upvalue-count 0 :arity 1 :constants ("get" "uv-value") :bytecode (16 0 1 1 0 52 0 0 2 50)} "uv-set!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "uv-value") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "make-vm-code" {:upvalue-count 0 :arity 4 :constants ("vc-bytecode" "vc-locals" "vc-arity" "vc-constants") :bytecode (1 0 0 16 2 1 1 0 16 1 1 2 0 16 0 1 3 0 16 3 65 4 0 50)} "make-vm-closure" {:upvalue-count 0 :arity 5 :constants ("vm-globals" "vm-upvalues" "vm-name" "vm-code" "vm-closure-env") :bytecode (1 0 0 16 3 1 1 0 16 1 1 2 0 16 2 1 3 0 16 0 1 4 0 16 4 65 5 0 50)} "make-vm-frame" {:upvalue-count 0 :arity 2 :constants ("ip" 0 "closure" "base" "local-cells") :bytecode (1 0 0 1 1 0 1 2 0 16 0 1 3 0 16 1 1 4 0 65 0 0 65 4 0 50)} "make-vm" {:upvalue-count 0 :arity 1 :constants ("sp" 0 "frames" "list" "stack" "make-vm-stack" 4096 "globals") :bytecode (1 0 0 1 1 0 1 2 0 52 3 0 0 1 4 0 1 6 0 52 5 0 1 1 7 0 16 0 65 4 0 50)} "vm-push" {:upvalue-count 0 :arity 2 :constants ("vm-sp" "vm-stack" ">=" "vm-stack-length" "vm-stack-grow" "vm-stack-copy!" "vm-set-stack!" "vm-stack-set!" "vm-set-sp!" "+" 1) :bytecode (20 0 0 16 0 48 1 17 2 20 1 0 16 0 48 1 17 3 16 2 16 3 52 3 0 1 52 2 0 2 33 39 0 20 4 0 16 3 16 2 48 2 17 4 16 3 16 4 16 2 52 5 0 3 5 20 6 0 16 0 16 4 48 2 5 16 4 17 3 32 1 0 2 5 16 3 16 2 16 1 52 7 0 3 5 20 8 0 16 0 16 2 1 10 0 52 9 0 2 49 2 50)} "vm-pop" {:upvalue-count 0 :arity 1 :constants ("-" "vm-sp" 1 "vm-set-sp!" "vm-stack-get" "vm-stack") :bytecode (20 1 0 16 0 48 1 1 2 0 52 0 0 2 17 1 20 3 0 16 0 16 1 48 2 5 20 5 0 16 0 48 1 16 1 52 4 0 2 50)} "vm-peek" {:upvalue-count 0 :arity 1 :constants ("vm-stack-get" "vm-stack" "-" "vm-sp" 1) :bytecode (20 1 0 16 0 48 1 20 3 0 16 0 48 1 1 4 0 52 2 0 2 52 0 0 2 50)} "frame-read-u8" {:upvalue-count 0 :arity 1 :constants ("frame-ip" "frame-closure" "closure-code" "code-bytecode" "nth" "frame-set-ip!" "+" 1) :bytecode (20 0 0 16 0 48 1 17 1 20 1 0 16 0 48 1 20 2 0 20 1 0 16 0 48 1 48 1 20 3 0 20 2 0 20 1 0 16 0 48 1 48 1 48 1 17 2 16 2 16 1 52 4 0 2 17 3 20 5 0 16 0 16 1 1 7 0 52 6 0 2 48 2 5 16 3 50)} "frame-read-u16" {:upvalue-count 0 :arity 1 :constants ("frame-read-u8" "+" "*" 256) :bytecode (20 0 0 16 0 48 1 17 1 20 0 0 16 0 48 1 17 2 16 1 16 2 1 3 0 52 2 0 2 52 1 0 2 50)} "frame-read-i16" {:upvalue-count 0 :arity 1 :constants ("frame-read-u16" ">=" 32768 "-" 65536) :bytecode (20 0 0 16 0 48 1 17 1 16 1 1 2 0 52 1 0 2 33 12 0 16 1 1 4 0 52 3 0 2 32 2 0 16 1 50)} "vm-push-frame" {:upvalue-count 0 :arity 3 :constants ("make-vm-frame" "vm-sp" "for-each" {:upvalue-count 1 :arity 1 :constants ("vm-push") :bytecode (20 0 0 18 0 16 0 49 2 50)} "pad-n-nils" "-" "code-locals" "closure-code" "len" "vm-set-frames!" "cons" "vm-frames") :bytecode (20 0 0 16 1 20 1 0 16 0 48 1 48 2 17 3 51 3 0 1 0 16 2 52 2 0 2 5 20 4 0 16 0 20 6 0 20 7 0 16 1 48 1 48 1 16 2 52 8 0 1 52 5 0 2 48 2 5 20 9 0 16 0 16 3 20 11 0 16 0 48 1 52 10 0 2 49 2 50)} "code-from-value" {:upvalue-count 0 :arity 1 :constants ("Convert a compiler output dict to a vm-code object." "not" "dict?" "make-vm-code" 0 16 "list" "get" "bytecode" "nil?" "constants" "arity" "+") :bytecode (1 0 0 5 16 0 52 2 0 1 52 1 0 1 33 22 0 20 3 0 1 4 0 1 5 0 52 6 0 0 52 6 0 0 49 4 32 112 0 16 0 1 8 0 52 7 0 2 17 1 16 1 52 9 0 1 33 7 0 52 6 0 0 32 2 0 16 1 17 2 16 0 1 10 0 52 7 0 2 17 3 16 3 52 9 0 1 33 7 0 52 6 0 0 32 2 0 16 3 17 4 16 0 1 11 0 52 7 0 2 17 5 16 5 52 9 0 1 33 6 0 1 4 0 32 2 0 16 5 17 6 20 3 0 16 6 16 6 1 5 0 52 12 0 2 16 2 16 4 49 4 50)} "vm-closure?" {:upvalue-count 0 :arity 1 :constants ("dict?" "has-key?" "vm-code") :bytecode (16 0 52 0 0 1 6 33 10 0 5 16 0 1 2 0 52 1 0 2 50)} "*active-vm*" "*jit-compile-fn*" "lambda?" {:upvalue-count 0 :arity 1 :constants ("=" "type-of" "lambda") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 50)} "lambda-compiled" {:upvalue-count 0 :arity 1 :constants () :bytecode (2 50)} "lambda-set-compiled!" {:upvalue-count 0 :arity 2 :constants () :bytecode (2 50)} "lambda-name" "cek-call-or-suspend" {:upvalue-count 0 :arity 3 :constants ("cek-call") :bytecode (16 1 16 2 52 0 0 2 50)} "try-jit-call" {:upvalue-count 0 :arity 3 :constants ("lambda-compiled" "vm-closure?" "vm-push" "vm-call-closure" "vm-globals-ref" "=" "jit-failed" "cek-call-or-suspend" "*jit-compile-fn*" "lambda-name" "lambda-set-compiled!") :bytecode (20 0 0 16 1 48 1 17 3 20 1 0 16 3 48 1 33 26 0 20 2 0 16 0 20 3 0 16 3 16 2 20 4 0 16 0 48 1 48 3 49 2 32 163 0 16 3 1 6 0 52 5 0 2 33 21 0 20 2 0 16 0 20 7 0 16 0 16 1 16 2 48 3 49 2 32 130 0 20 8 0 6 33 8 0 5 20 9 0 16 1 48 1 33 94 0 20 10 0 16 1 1 6 0 48 2 5 20 8 0 16 1 20 4 0 16 0 48 1 48 2 17 4 20 1 0 16 4 48 1 33 36 0 20 10 0 16 1 16 4 48 2 5 20 2 0 16 0 20 3 0 16 4 16 2 20 4 0 16 0 48 1 48 3 49 2 32 18 0 20 2 0 16 0 20 7 0 16 0 16 1 16 2 48 3 49 2 32 18 0 20 2 0 16 0 20 7 0 16 0 16 1 16 2 48 3 49 2 50)} "vm-call" {:upvalue-count 0 :arity 3 :constants ("vm-closure?" "vm-push-frame" "lambda?" "try-jit-call" "=" "type-of" "component" "island" "vm-push" "cek-call-or-suspend" "callable?" "apply" "error" "str" "VM: not callable: ") :bytecode (20 0 0 16 1 48 1 33 14 0 20 1 0 16 0 16 1 16 2 49 3 32 123 0 16 1 52 2 0 1 33 14 0 20 3 0 16 0 16 1 16 2 49 3 32 100 0 16 1 52 5 0 1 1 6 0 52 4 0 2 6 34 14 0 5 16 1 52 5 0 1 1 7 0 52 4 0 2 33 21 0 20 8 0 16 0 20 9 0 16 0 16 1 16 2 48 3 49 2 32 45 0 20 10 0 16 1 48 1 33 18 0 20 8 0 16 0 16 1 16 2 52 11 0 2 49 2 32 17 0 1 14 0 16 1 52 5 0 1 52 13 0 2 52 12 0 1 50)} "frame-local-get" {:upvalue-count 0 :arity 3 :constants ("Read a local variable — check shared cells first, then stack." "get" "local-cells" "str" "has-key?" "uv-get" "vm-stack-get" "vm-stack" "+" "frame-base") :bytecode (1 0 0 5 16 1 1 2 0 52 1 0 2 17 3 16 2 52 3 0 1 17 4 16 3 16 4 52 4 0 2 33 16 0 20 5 0 16 3 16 4 52 1 0 2 49 1 32 24 0 20 7 0 16 0 48 1 20 9 0 16 1 48 1 16 2 52 8 0 2 52 6 0 2 50)} "frame-local-set" {:upvalue-count 0 :arity 4 :constants ("Write a local variable — to shared cell or stack." "get" "local-cells" "str" "has-key?" "uv-set!" "vm-stack-set!" "vm-stack" "+" "frame-base") :bytecode (1 0 0 5 16 1 1 2 0 52 1 0 2 17 4 16 2 52 3 0 1 17 5 16 4 16 5 52 4 0 2 33 18 0 20 5 0 16 4 16 5 52 1 0 2 16 3 49 2 32 26 0 20 7 0 16 0 48 1 20 9 0 16 1 48 1 16 2 52 8 0 2 16 3 52 6 0 3 50)} "frame-upvalue-get" {:upvalue-count 0 :arity 2 :constants ("uv-get" "nth" "frame-closure" "closure-upvalues") :bytecode (20 0 0 20 2 0 16 0 48 1 20 3 0 20 2 0 16 0 48 1 48 1 16 1 52 1 0 2 49 1 50)} "frame-upvalue-set" {:upvalue-count 0 :arity 3 :constants ("uv-set!" "nth" "frame-closure" "closure-upvalues") :bytecode (20 0 0 20 2 0 16 0 48 1 20 3 0 20 2 0 16 0 48 1 48 1 16 1 52 1 0 2 16 2 49 2 50)} "frame-ip" {:upvalue-count 0 :arity 1 :constants ("get" "ip") :bytecode (16 0 1 1 0 52 0 0 2 50)} "frame-set-ip!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "ip") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "frame-base" {:upvalue-count 0 :arity 1 :constants ("get" "base") :bytecode (16 0 1 1 0 52 0 0 2 50)} "frame-closure" {:upvalue-count 0 :arity 1 :constants ("get" "closure") :bytecode (16 0 1 1 0 52 0 0 2 50)} "closure-code" {:upvalue-count 0 :arity 1 :constants ("get" "vm-code") :bytecode (16 0 1 1 0 52 0 0 2 50)} "closure-upvalues" {:upvalue-count 0 :arity 1 :constants ("get" "vm-upvalues") :bytecode (16 0 1 1 0 52 0 0 2 50)} "closure-env" {:upvalue-count 0 :arity 1 :constants ("get" "closure-env") :bytecode (16 0 1 1 0 52 0 0 2 50)} "code-bytecode" {:upvalue-count 0 :arity 1 :constants ("get" "vc-bytecode") :bytecode (16 0 1 1 0 52 0 0 2 50)} "code-constants" {:upvalue-count 0 :arity 1 :constants ("get" "vc-constants") :bytecode (16 0 1 1 0 52 0 0 2 50)} "code-locals" {:upvalue-count 0 :arity 1 :constants ("get" "vc-locals") :bytecode (16 0 1 1 0 52 0 0 2 50)} "vm-sp" {:upvalue-count 0 :arity 1 :constants ("get" "sp") :bytecode (16 0 1 1 0 52 0 0 2 50)} "vm-set-sp!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "sp") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "vm-stack" {:upvalue-count 0 :arity 1 :constants ("get" "stack") :bytecode (16 0 1 1 0 52 0 0 2 50)} "vm-set-stack!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "stack") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "vm-frames" {:upvalue-count 0 :arity 1 :constants ("get" "frames") :bytecode (16 0 1 1 0 52 0 0 2 50)} "vm-set-frames!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "frames") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "vm-globals-ref" {:upvalue-count 0 :arity 1 :constants ("get" "globals") :bytecode (16 0 1 1 0 52 0 0 2 50)} "collect-n-from-stack" {:upvalue-count 0 :arity 2 :constants ("list" 0 {:upvalue-count 5 :arity 0 :constants ("<" "cons" "vm-pop" "+" 1) :bytecode (18 0 18 1 52 0 0 2 33 35 0 20 2 0 18 3 48 1 18 2 52 1 0 2 19 2 5 18 0 1 4 0 52 3 0 2 19 0 5 18 4 49 0 32 1 0 2 50)}) :bytecode (52 0 0 0 17 2 1 1 0 17 3 51 2 0 1 3 1 1 1 2 1 0 1 4 17 4 5 16 4 48 0 5 16 2 50)} "pad-n-nils" {:upvalue-count 0 :arity 2 :constants (0 {:upvalue-count 4 :arity 0 :constants ("<" "vm-push" "+" 1) :bytecode (18 0 18 1 52 0 0 2 33 28 0 20 1 0 18 2 2 48 2 5 18 0 1 3 0 52 2 0 2 19 0 5 18 3 49 0 32 1 0 2 50)}) :bytecode (1 0 0 17 2 51 1 0 1 2 1 1 1 0 1 3 17 3 5 16 3 49 0 50)} "collect-n-pairs" {:upvalue-count 0 :arity 2 :constants (0 {:upvalue-count 5 :arity 0 :constants ("<" "vm-pop" "dict-set!" "+" 1) :bytecode (18 0 18 1 52 0 0 2 33 48 0 20 1 0 18 2 48 1 17 0 20 1 0 18 2 48 1 17 1 18 3 16 1 16 0 52 2 0 3 5 18 0 1 4 0 52 3 0 2 19 0 5 18 4 49 0 32 1 0 2 50)}) :bytecode (65 0 0 17 2 1 0 0 17 3 51 1 0 1 3 1 1 1 0 1 2 1 4 17 4 5 16 4 48 0 5 16 2 50)} "vm-global-get" {:upvalue-count 0 :arity 3 :constants ("Look up a global: globals table → closure env → primitives → HO wrappers" "vm-globals-ref" "has-key?" "get" "frame-closure" "nil?" "cek-try" {:upvalue-count 1 :arity 0 :constants ("get-primitive") :bytecode (18 0 52 0 0 1 50)} {:upvalue-count 2 :arity 1 :constants ("vm-resolve-ho-form") :bytecode (20 0 0 18 0 18 1 49 2 50)} "env-walk") :bytecode (1 0 0 5 20 1 0 16 0 48 1 17 3 16 3 16 2 52 2 0 2 33 11 0 16 3 16 2 52 3 0 2 32 89 0 20 4 0 16 1 48 1 16 4 20 4 0 16 1 48 1 48 1 17 4 16 4 52 5 0 1 33 19 0 51 7 0 1 2 51 8 0 1 0 1 2 52 6 0 2 32 41 0 20 9 0 16 4 16 2 48 2 17 5 16 5 52 5 0 1 33 19 0 51 7 0 1 2 51 8 0 1 0 1 2 52 6 0 2 32 2 0 16 5 50)} "vm-resolve-ho-form" {:upvalue-count 0 :arity 2 :constants ("for-each" "=" {:upvalue-count 1 :arity 2 :constants ("for-each" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "map" {:upvalue-count 1 :arity 2 :constants ("map" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "map-indexed" {:upvalue-count 1 :arity 2 :constants ("map-indexed" {:upvalue-count 2 :arity 2 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 16 1 52 1 0 2 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "filter" {:upvalue-count 1 :arity 2 :constants ("filter" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "reduce" {:upvalue-count 1 :arity 3 :constants ("reduce" {:upvalue-count 2 :arity 2 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 16 1 52 1 0 2 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 16 2 52 0 0 3 50)} "some" {:upvalue-count 1 :arity 2 :constants ("some" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "every?" {:upvalue-count 1 :arity 2 :constants ("every?" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "error" "str" "VM undefined: ") :bytecode (16 1 6 1 0 0 52 1 0 2 33 9 0 5 51 2 0 1 0 32 134 0 6 1 3 0 52 1 0 2 33 9 0 5 51 4 0 1 0 32 114 0 6 1 5 0 52 1 0 2 33 9 0 5 51 6 0 1 0 32 94 0 6 1 7 0 52 1 0 2 33 9 0 5 51 8 0 1 0 32 74 0 6 1 9 0 52 1 0 2 33 9 0 5 51 10 0 1 0 32 54 0 6 1 11 0 52 1 0 2 33 9 0 5 51 12 0 1 0 32 34 0 6 1 13 0 52 1 0 2 33 9 0 5 51 14 0 1 0 32 14 0 5 1 17 0 16 1 52 16 0 2 52 15 0 1 50)} "vm-call-external" {:upvalue-count 0 :arity 3 :constants ("vm-closure?" "vm-call-closure" "vm-globals-ref" "cek-call") :bytecode (20 0 0 16 1 48 1 33 19 0 20 1 0 16 1 16 2 20 2 0 16 0 48 1 49 3 32 8 0 16 1 16 2 52 3 0 2 50)} "vm-global-set" {:upvalue-count 0 :arity 4 :constants ("Set a global: write to closure env if found, else globals table." "get" "frame-closure" "vm-closure-env" "not" "nil?" "env-walk-set!" "dict-set!" "vm-globals-ref") :bytecode (1 0 0 5 20 2 0 16 1 48 1 1 3 0 52 1 0 2 17 4 4 17 5 16 4 52 5 0 1 52 4 0 1 33 16 0 20 6 0 16 4 16 2 16 3 48 3 17 5 32 1 0 2 5 16 5 52 4 0 1 33 18 0 20 8 0 16 0 48 1 16 2 16 3 52 7 0 3 32 1 0 2 50)} "env-walk" {:upvalue-count 0 :arity 2 :constants ("nil?" "env-has?" "env-get" "env-parent" "env-walk") :bytecode (16 0 52 0 0 1 33 4 0 2 32 53 0 16 0 16 1 52 1 0 2 33 11 0 16 0 16 1 52 2 0 2 32 31 0 20 3 0 16 0 48 1 17 2 16 2 52 0 0 1 33 4 0 2 32 9 0 20 4 0 16 2 16 1 49 2 50)} "env-walk-set!" {:upvalue-count 0 :arity 3 :constants ("nil?" "env-has?" "env-set!" "env-parent" "env-walk-set!") :bytecode (16 0 52 0 0 1 33 4 0 4 32 59 0 16 0 16 1 52 1 0 2 33 15 0 16 0 16 1 16 2 52 2 0 3 5 3 32 33 0 20 3 0 16 0 48 1 17 3 16 3 52 0 0 1 33 4 0 4 32 11 0 20 4 0 16 3 16 1 16 2 49 3 50)} "vm-create-closure" {:upvalue-count 0 :arity 3 :constants ("Create a closure from a code constant. Reads upvalue descriptors\n from the bytecode stream and captures values from the enclosing frame." "code-from-value" "dict?" "get" "upvalue-count" 0 "list" {:upvalue-count 6 :arity 0 :constants ("<" "frame-read-u8" "=" 1 "get" "local-cells" "str" "has-key?" "make-upvalue-cell" "vm-stack-get" "vm-stack" "+" "frame-base" "dict-set!" "nth" "frame-closure" "closure-upvalues" "append!") :bytecode (18 0 18 1 52 0 0 2 33 173 0 20 1 0 18 2 48 1 17 0 20 1 0 18 2 48 1 17 1 16 0 1 3 0 52 2 0 2 33 88 0 18 2 1 5 0 52 4 0 2 17 3 16 1 52 6 0 1 17 4 16 3 16 4 52 7 0 2 33 11 0 16 3 16 4 52 4 0 2 32 44 0 20 8 0 20 10 0 18 3 48 1 20 12 0 18 2 48 1 16 1 52 11 0 2 52 9 0 2 48 1 17 5 16 3 16 4 16 5 52 13 0 3 5 16 5 32 25 0 20 15 0 18 2 48 1 20 16 0 20 15 0 18 2 48 1 48 1 16 1 52 14 0 2 17 2 18 4 16 2 52 17 0 2 5 18 0 1 3 0 52 11 0 2 19 0 5 18 5 49 0 32 1 0 2 50)} "make-vm-closure" "vm-globals-ref") :bytecode (1 0 0 5 20 1 0 16 2 48 1 17 3 16 2 52 2 0 1 33 20 0 16 2 1 4 0 52 3 0 2 6 34 4 0 5 1 5 0 32 3 0 1 5 0 17 4 52 6 0 0 17 6 1 5 0 17 7 51 7 0 1 7 1 4 1 1 1 0 1 6 1 8 17 8 5 16 8 48 0 5 16 6 17 5 20 8 0 16 3 16 5 2 20 9 0 16 0 48 1 2 49 5 50)} "vm-run" {:upvalue-count 0 :arity 2 :constants ("Execute bytecode until all frames are done or IO suspension." {:upvalue-count 2 :arity 0 :constants ("not" "empty?" "vm-frames" "first" "rest" "frame-closure" "closure-code" "code-bytecode" "code-constants" ">=" "frame-ip" "len" "vm-set-frames!" "list" "vm-step" "nil?" "get" "vm-globals-ref" "__io_request") :bytecode (20 2 0 18 0 48 1 52 1 0 1 52 0 0 1 33 184 0 20 2 0 18 0 48 1 52 3 0 1 17 0 20 2 0 18 0 48 1 52 4 0 1 17 1 20 5 0 16 0 48 1 20 6 0 20 5 0 16 0 48 1 48 1 20 7 0 20 6 0 20 5 0 16 0 48 1 48 1 48 1 17 2 20 5 0 16 0 48 1 20 6 0 20 5 0 16 0 48 1 48 1 20 8 0 20 6 0 20 5 0 16 0 48 1 48 1 48 1 17 3 20 10 0 16 0 48 1 16 2 52 11 0 1 52 9 0 2 33 14 0 20 12 0 18 0 52 13 0 0 49 2 32 45 0 20 14 0 18 0 16 0 16 1 16 2 16 3 48 5 5 20 17 0 18 0 48 1 1 18 0 52 16 0 2 52 15 0 1 33 7 0 18 1 49 0 32 1 0 2 32 1 0 2 50)}) :bytecode (1 0 0 5 51 1 0 1 0 1 1 17 1 5 16 1 49 0 50)} "vm-step" {:upvalue-count 0 :arity 5 :constants ("frame-read-u8" "=" 1 "frame-read-u16" "vm-push" "nth" 2 3 4 5 "vm-pop" 6 "vm-peek" 16 "frame-local-get" 17 "frame-local-set" 18 "frame-upvalue-get" 19 "frame-upvalue-set" 20 "vm-global-get" 21 "vm-global-set" 32 "frame-read-i16" "frame-set-ip!" "+" "frame-ip" 33 "not" 34 48 "collect-n-from-stack" "vm-call" 49 "vm-set-frames!" "vm-set-sp!" "frame-base" 50 51 "vm-create-closure" 52 "call-primitive" 64 65 "collect-n-pairs" 144 "apply" "str" 128 "dict-set!" "vm-globals-ref" 160 161 "-" 162 "*" 163 "/" 164 165 "<" 166 ">" 167 168 "len" 169 "first" 170 "rest" 171 172 "cons" 173 0 174 "inc" 175 "dec" 112 "__io_request" "error" "VM: unknown opcode ") :bytecode (20 0 0 16 1 48 1 17 5 16 5 1 2 0 52 1 0 2 33 27 0 20 3 0 16 1 48 1 17 6 20 4 0 16 0 16 4 16 6 52 5 0 2 49 2 32 254 6 16 5 1 6 0 52 1 0 2 33 11 0 20 4 0 16 0 2 49 2 32 231 6 16 5 1 7 0 52 1 0 2 33 11 0 20 4 0 16 0 3 49 2 32 208 6 16 5 1 8 0 52 1 0 2 33 11 0 20 4 0 16 0 4 49 2 32 185 6 16 5 1 9 0 52 1 0 2 33 10 0 20 10 0 16 0 49 1 32 163 6 16 5 1 11 0 52 1 0 2 33 17 0 20 4 0 16 0 20 12 0 16 0 48 1 49 2 32 134 6 16 5 1 13 0 52 1 0 2 33 30 0 20 0 0 16 1 48 1 17 6 20 4 0 16 0 20 14 0 16 0 16 1 16 6 48 3 49 2 32 92 6 16 5 1 15 0 52 1 0 2 33 30 0 20 0 0 16 1 48 1 17 6 20 16 0 16 0 16 1 16 6 20 12 0 16 0 48 1 49 4 32 50 6 16 5 1 17 0 52 1 0 2 33 28 0 20 0 0 16 1 48 1 17 6 20 4 0 16 0 20 18 0 16 1 16 6 48 2 49 2 32 10 6 16 5 1 19 0 52 1 0 2 33 28 0 20 0 0 16 1 48 1 17 6 20 20 0 16 1 16 6 20 12 0 16 0 48 1 49 3 32 226 5 16 5 1 21 0 52 1 0 2 33 40 0 20 3 0 16 1 48 1 17 6 16 4 16 6 52 5 0 2 17 7 20 4 0 16 0 20 22 0 16 0 16 1 16 7 48 3 49 2 32 174 5 16 5 1 23 0 52 1 0 2 33 40 0 20 3 0 16 1 48 1 17 6 16 4 16 6 52 5 0 2 17 7 20 24 0 16 0 16 1 16 7 20 12 0 16 0 48 1 49 4 32 122 5 16 5 1 25 0 52 1 0 2 33 32 0 20 26 0 16 1 48 1 17 6 20 27 0 16 1 20 29 0 16 1 48 1 16 6 52 28 0 2 49 2 32 78 5 16 5 1 30 0 52 1 0 2 33 54 0 20 26 0 16 1 48 1 17 6 20 10 0 16 0 48 1 17 7 16 7 52 31 0 1 33 23 0 20 27 0 16 1 20 29 0 16 1 48 1 16 6 52 28 0 2 49 2 32 1 0 2 32 12 5 16 5 1 32 0 52 1 0 2 33 50 0 20 26 0 16 1 48 1 17 6 20 10 0 16 0 48 1 17 7 16 7 33 23 0 20 27 0 16 1 20 29 0 16 1 48 1 16 6 52 28 0 2 49 2 32 1 0 2 32 206 4 16 5 1 33 0 52 1 0 2 33 43 0 20 0 0 16 1 48 1 17 6 20 34 0 16 0 16 6 48 2 17 7 20 10 0 16 0 48 1 17 8 20 35 0 16 0 16 8 16 7 49 3 32 151 4 16 5 1 36 0 52 1 0 2 33 68 0 20 0 0 16 1 48 1 17 6 20 34 0 16 0 16 6 48 2 17 7 20 10 0 16 0 48 1 17 8 20 37 0 16 0 16 2 48 2 5 20 38 0 16 0 20 39 0 16 1 48 1 48 2 5 20 35 0 16 0 16 8 16 7 49 3 32 71 4 16 5 1 40 0 52 1 0 2 33 46 0 20 10 0 16 0 48 1 17 6 20 37 0 16 0 16 2 48 2 5 20 38 0 16 0 20 39 0 16 1 48 1 48 2 5 20 4 0 16 0 16 6 49 2 32 13 4 16 5 1 41 0 52 1 0 2 33 44 0 20 3 0 16 1 48 1 17 6 16 4 16 6 52 5 0 2 17 7 20 42 0 16 0 16 1 16 7 48 3 17 8 20 4 0 16 0 16 8 49 2 32 213 3 16 5 1 43 0 52 1 0 2 33 57 0 20 3 0 16 1 48 1 17 6 20 0 0 16 1 48 1 17 7 16 4 16 6 52 5 0 2 17 8 20 34 0 16 0 16 7 48 2 17 9 20 4 0 16 0 16 8 16 9 52 44 0 2 49 2 32 144 3 16 5 1 45 0 52 1 0 2 33 32 0 20 3 0 16 1 48 1 17 6 20 34 0 16 0 16 6 48 2 17 7 20 4 0 16 0 16 7 49 2 32 100 3 16 5 1 46 0 52 1 0 2 33 32 0 20 3 0 16 1 48 1 17 6 20 47 0 16 0 16 6 48 2 17 7 20 4 0 16 0 16 7 49 2 32 56 3 16 5 1 48 0 52 1 0 2 33 39 0 20 0 0 16 1 48 1 17 6 20 34 0 16 0 16 6 48 2 17 7 20 4 0 16 0 20 50 0 16 7 52 49 0 2 49 2 32 5 3 16 5 1 51 0 52 1 0 2 33 42 0 20 3 0 16 1 48 1 17 6 16 4 16 6 52 5 0 2 17 7 20 53 0 16 0 48 1 16 7 20 12 0 16 0 48 1 52 52 0 3 32 207 2 16 5 1 54 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 28 0 2 49 2 32 159 2 16 5 1 55 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 56 0 2 49 2 32 111 2 16 5 1 57 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 58 0 2 49 2 32 63 2 16 5 1 59 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 60 0 2 49 2 32 15 2 16 5 1 61 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 1 0 2 49 2 32 223 1 16 5 1 62 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 63 0 2 49 2 32 175 1 16 5 1 64 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 65 0 2 49 2 32 127 1 16 5 1 66 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 31 0 1 49 2 32 94 1 16 5 1 67 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 68 0 1 49 2 32 61 1 16 5 1 69 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 70 0 1 49 2 32 28 1 16 5 1 71 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 72 0 1 49 2 32 251 0 16 5 1 73 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 5 0 2 49 2 32 203 0 16 5 1 74 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 75 0 2 49 2 32 155 0 16 5 1 76 0 52 1 0 2 33 24 0 20 4 0 16 0 1 77 0 20 10 0 16 0 48 1 52 56 0 2 49 2 32 119 0 16 5 1 78 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 79 0 1 49 2 32 86 0 16 5 1 80 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 81 0 1 49 2 32 53 0 16 5 1 82 0 52 1 0 2 33 28 0 20 10 0 16 0 48 1 17 6 20 53 0 16 0 48 1 1 83 0 16 6 52 52 0 3 32 13 0 1 85 0 16 5 52 50 0 2 52 84 0 1 50)} "vm-call-closure" {:upvalue-count 0 :arity 3 :constants ("*active-vm*" "make-vm" "vm-push-frame" "vm-run" "vm-pop") :bytecode (20 0 0 17 3 20 1 0 16 2 48 1 17 4 16 4 21 0 0 5 20 2 0 16 4 16 0 16 1 48 3 5 20 3 0 16 4 48 1 5 16 3 21 0 0 5 20 4 0 16 4 49 1 50)} "vm-execute-module" {:upvalue-count 0 :arity 2 :constants ("code-from-value" "make-vm" "make-vm-closure" "list" "module" "make-vm-frame" 0 "pad-n-nils" "code-locals" "vm-set-frames!" "vm-run" "get" "vm-globals-ref" "__io_request" "nil?" "vm-pop" "vm" "suspended" "op" "import" "request") :bytecode (20 0 0 16 0 48 1 17 2 20 1 0 16 1 48 1 17 3 20 2 0 16 2 52 3 0 0 1 4 0 16 1 2 48 5 17 4 20 5 0 16 4 1 6 0 48 2 17 5 20 7 0 16 3 20 8 0 16 2 48 1 48 2 5 20 9 0 16 3 16 5 52 3 0 1 48 2 5 20 10 0 16 3 48 1 5 20 12 0 16 3 48 1 1 13 0 52 11 0 2 17 6 16 6 52 14 0 1 33 10 0 20 15 0 16 3 49 1 32 23 0 1 16 0 16 3 1 17 0 3 1 18 0 1 19 0 1 20 0 16 6 65 4 0 50)} "vm-resume-module" {:upvalue-count 0 :arity 1 :constants ("Resume a suspended VM after IO (import) has been resolved.\n Clears __io_request in globals, pushes nil (import result), re-runs." "get" "vm" "dict-set!" "vm-globals-ref" "__io_request" "vm-push" "vm-run" "nil?" "vm-pop" "suspended" "op" "import" "request") :bytecode (1 0 0 5 16 0 1 2 0 52 1 0 2 17 1 20 4 0 16 1 48 1 1 5 0 2 52 3 0 3 5 20 6 0 16 1 2 48 2 5 20 7 0 16 1 48 1 5 20 4 0 16 1 48 1 1 5 0 52 1 0 2 17 2 16 2 52 8 0 1 33 10 0 20 9 0 16 1 49 1 32 23 0 1 2 0 16 1 1 10 0 3 1 11 0 1 12 0 1 13 0 16 2 65 4 0 50)} {:library (sx vm) :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 2 128 32 0 5 2 128 33 0 5 51 35 0 128 34 0 5 51 37 0 128 36 0 5 51 39 0 128 38 0 5 51 37 0 128 40 0 5 51 42 0 128 41 0 5 51 44 0 128 43 0 5 51 46 0 128 45 0 5 51 48 0 128 47 0 5 51 50 0 128 49 0 5 51 52 0 128 51 0 5 51 54 0 128 53 0 5 51 56 0 128 55 0 5 51 58 0 128 57 0 5 51 60 0 128 59 0 5 51 62 0 128 61 0 5 51 64 0 128 63 0 5 51 66 0 128 65 0 5 51 68 0 128 67 0 5 51 70 0 128 69 0 5 51 72 0 128 71 0 5 51 74 0 128 73 0 5 51 76 0 128 75 0 5 51 78 0 128 77 0 5 51 80 0 128 79 0 5 51 82 0 128 81 0 5 51 84 0 128 83 0 5 51 86 0 128 85 0 5 51 88 0 128 87 0 5 51 90 0 128 89 0 5 51 92 0 128 91 0 5 51 94 0 128 93 0 5 51 96 0 128 95 0 5 51 98 0 128 97 0 5 51 100 0 128 99 0 5 51 102 0 128 101 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 1 119 0 112 50))) diff --git a/shared/static/wasm/sx_browser.bc.wasm.js b/shared/static/wasm/sx_browser.bc.wasm.js index e86abf8f..8baa5983 100644 --- a/shared/static/wasm/sx_browser.bc.wasm.js +++ b/shared/static/wasm/sx_browser.bc.wasm.js @@ -1792,7 +1792,7 @@ blake2_js_for_wasm_create: blake2_js_for_wasm_create}; } (globalThis)) -({"link":[["runtime-0db9b496",0],["prelude-d7e4b000",0],["stdlib-23ce0836",[]],["sx-d4b9c764",[2]],["jsoo_runtime-f96b44a8",[2]],["js_of_ocaml-651f6707",[2,4]],["dune__exe__Sx_browser-ba5b5565",[2,3,5]],["std_exit-10fb8830",[2]],["start-f5d3f095",0]],"generated":(b=>{var +({"link":[["runtime-0db9b496",0],["prelude-d7e4b000",0],["stdlib-23ce0836",[]],["sx-90abc6ab",[2]],["jsoo_runtime-f96b44a8",[2]],["js_of_ocaml-651f6707",[2,4]],["dune__exe__Sx_browser-216e88df",[2,3,5]],["std_exit-10fb8830",[2]],["start-f5d3f095",0]],"generated":(b=>{var c=b,a=b?.module?.export||b;return{"env":{"caml_ba_kind_of_typed_array":()=>{throw new Error("caml_ba_kind_of_typed_array not implemented")},"caml_exn_with_js_backtrace":()=>{throw new Error("caml_exn_with_js_backtrace not implemented")},"caml_int64_create_lo_mi_hi":()=>{throw new