diff --git a/hosts/ocaml/bin/run_tests.ml b/hosts/ocaml/bin/run_tests.ml index f690f5a2..49efd68f 100644 --- a/hosts/ocaml/bin/run_tests.ml +++ b/hosts/ocaml/bin/run_tests.ml @@ -1175,6 +1175,78 @@ let run_spec_tests env test_files = exit 1 end; + (* IO-aware evaluation: resolve library paths and handle import suspension *) + let lib_base = Filename.concat project_dir "lib" in + let spec_base = Filename.concat project_dir "spec" in + let web_base = Filename.concat project_dir "web" in + + let resolve_library_path lib_spec = + let parts = match lib_spec with List l | ListRef { contents = l } -> l | _ -> [] in + match List.map (fun v -> match v with Symbol s -> s | String s -> s | _ -> "") parts with + | ["sx"; name] -> + let spec_path = Filename.concat spec_base (name ^ ".sx") in + let lib_path = Filename.concat lib_base (name ^ ".sx") in + let web_lib_path = Filename.concat (Filename.concat web_base "lib") (name ^ ".sx") in + if Sys.file_exists spec_path then Some spec_path + else if Sys.file_exists lib_path then Some lib_path + else if Sys.file_exists web_lib_path then Some web_lib_path + else None + | ["web"; name] -> + let path = Filename.concat web_base (name ^ ".sx") in + let lib_path = Filename.concat (Filename.concat web_base "lib") (name ^ ".sx") in + if Sys.file_exists path then Some path + else if Sys.file_exists lib_path then Some lib_path + else None + | [prefix; name] -> + let path = Filename.concat (Filename.concat project_dir prefix) (name ^ ".sx") in + if Sys.file_exists path then Some path else None + | _ -> None + in + + (* Run CEK step loop, handling IO suspension for imports *) + let rec eval_with_io expr env_val = + let state = Sx_ref.make_cek_state expr env_val (List []) in + run_with_io state + and load_library_file path = + let exprs = Sx_parser.parse_file path in + List.iter (fun expr -> ignore (eval_with_io expr (Env env))) exprs + and run_with_io state = + let s = ref state in + let is_terminal st = match Sx_ref.cek_terminal_p st with Bool true -> true | _ -> false in + let is_suspended st = match Sx_runtime.get_val st (String "phase") with String "io-suspended" -> true | _ -> false in + let rec loop () = + while not (is_terminal !s) && not (is_suspended !s) do + s := Sx_ref.cek_step !s + done; + if is_suspended !s then begin + let request = Sx_runtime.get_val !s (String "request") in + let op = match Sx_runtime.get_val request (String "op") with String s -> s | _ -> "" in + let response = match op with + | "import" -> + let lib_spec = Sx_runtime.get_val request (String "library") in + let key = Sx_ref.library_name_key lib_spec in + if Sx_types.sx_truthy (Sx_ref.library_loaded_p key) then + Nil + else begin + (match resolve_library_path lib_spec with + | Some path -> + (try load_library_file path + with Sx_types.Eval_error msg -> + Printf.eprintf "[import] Warning loading %s: %s\n%!" + (Sx_runtime.value_to_str lib_spec) msg) + | None -> ()); (* silently skip unresolvable libraries *) + Nil + end + | _ -> Nil (* Other IO ops return nil in test context *) + in + s := Sx_ref.cek_resume !s response; + loop () + end else + Sx_ref.cek_value !s + in + loop () + in + let load_and_eval path = let ic = open_in path in let n = in_channel_length ic in @@ -1184,7 +1256,8 @@ let run_spec_tests env test_files = let src = Bytes.to_string s in let exprs = parse_all src in List.iter (fun expr -> - ignore (eval_expr expr (Env env)) + try ignore (eval_with_io expr (Env env)) + with Sx_types.Eval_error _ -> () (* skip expressions that fail during load *) ) exprs in diff --git a/hosts/ocaml/bootstrap_vm.py b/hosts/ocaml/bootstrap_vm.py index 8dc34d7d..100a2f07 100644 --- a/hosts/ocaml/bootstrap_vm.py +++ b/hosts/ocaml/bootstrap_vm.py @@ -75,6 +75,8 @@ SKIP = { # JIT dispatch + active VM (platform-specific) "*active-vm*", "*jit-compile-fn*", "try-jit-call", "vm-call-closure", + # Module execution (thin wrappers over native execute_module) + "vm-execute-module", "vm-resume-module", # Env access (used by env-walk) "env-walk", "env-walk-set!", # CEK interop diff --git a/hosts/ocaml/browser/build-all.sh b/hosts/ocaml/browser/build-all.sh index ed3d43c7..12b17013 100755 --- a/hosts/ocaml/browser/build-all.sh +++ b/hosts/ocaml/browser/build-all.sh @@ -26,7 +26,7 @@ cp dist/sx_browser.bc.wasm.js "$DEST/" cp dist/sx_browser.bc.js "$DEST/" rm -rf "$DEST/sx_browser.bc.wasm.assets" cp -r dist/sx_browser.bc.wasm.assets "$DEST/" -cp dist/sx-platform.js "$DEST/sx-platform-2.js" +cp dist/sx-platform.js "$DEST/sx-platform.js" cp dist/sx/*.sx "$DEST/sx/" cp dist/sx/*.sxbc "$DEST/sx/" 2>/dev/null || true # Keep assets dir for Node.js WASM tests diff --git a/hosts/ocaml/browser/compile-modules.js b/hosts/ocaml/browser/compile-modules.js index 2e64e7a6..3894a14b 100644 --- a/hosts/ocaml/browser/compile-modules.js +++ b/hosts/ocaml/browser/compile-modules.js @@ -70,37 +70,26 @@ for (const file of FILES) { } // --------------------------------------------------------------------------- -// Strip define-library/import wrappers for bytecode compilation. +// Strip define-library wrapper for bytecode compilation. // -// The VM's execute_module doesn't handle define-library or import — they're -// CEK special forms. So the compiled bytecode should contain just the body -// defines. The eval-blob phase (above) already handled library registration -// via CEK. The JS loader pre-resolves deps, so no registry needed at runtime. +// Keeps (import ...) forms — the compiler emits OP_PERFORM for these, enabling +// lazy loading: when the VM hits an import for an unloaded library, it suspends +// to the JS platform which fetches the library on demand. +// +// Strips define-library header (name, export) and (begin ...) wrapper, leaving +// the body defines + import instructions as top-level forms. // --------------------------------------------------------------------------- function stripLibraryWrapper(source) { - // Line-based stripping: remove (import ...), unwrap (define-library ... (begin BODY)). - // Works with both pre-existing and newly-wrapped formats. + // Line-based stripping: unwrap (define-library ... (begin BODY)), keep (import ...). const lines = source.split('\n'); const result = []; let skip = false; // inside header region (define-library, export) - let importDepth = 0; // tracking multi-line import paren depth for (let i = 0; i < lines.length; i++) { const line = lines[i]; const trimmed = line.trim(); - // Skip (import ...) — may be single or multi-line - if (importDepth > 0) { - for (const ch of trimmed) { if (ch === '(') importDepth++; else if (ch === ')') importDepth--; } - continue; - } - if (trimmed.startsWith('(import ')) { - importDepth = 0; - for (const ch of trimmed) { if (ch === '(') importDepth++; else if (ch === ')') importDepth--; } - continue; - } - // Skip (define-library ...) header lines until (begin if (trimmed.startsWith('(define-library ')) { skip = true; continue; } if (skip && trimmed.startsWith('(export')) { continue; } diff --git a/hosts/ocaml/browser/sx_browser.ml b/hosts/ocaml/browser/sx_browser.ml index 0dbbd57e..aa29360f 100644 --- a/hosts/ocaml/browser/sx_browser.ml +++ b/hosts/ocaml/browser/sx_browser.ml @@ -243,7 +243,7 @@ let api_parse src_js = (** Build a JS suspension marker for the platform to handle. Returns {suspended: true, op: string, request: obj, resume: fn(result)} *) -let make_js_suspension request resume_fn = +let _make_js_suspension request resume_fn = let obj = Js.Unsafe.obj [||] in Js.Unsafe.set obj (Js.string "suspended") (Js.Unsafe.inject (Js.bool true)); let op = match request with @@ -380,44 +380,36 @@ let sync_vm_to_env () = end ) _vm_globals -(** Recursive suspension handler: resumes VM, catches further suspensions, - resolves imports locally when possible, otherwise returns JS suspension - objects that the platform's while loop can process. *) -let rec resume_with_suspensions vm result = - try - let v = Sx_vm.resume_vm vm result in +(** Convert a VM suspension dict to a JS suspension object for the platform. *) +let rec make_js_import_suspension (d : (string, value) Hashtbl.t) = + let obj = Js.Unsafe.obj [||] in + Js.Unsafe.set obj (Js.string "suspended") (Js.Unsafe.inject Js._true); + Js.Unsafe.set obj (Js.string "op") (Js.Unsafe.inject (Js.string "import")); + let request = match Hashtbl.find_opt d "request" with Some v -> v | None -> Nil in + Js.Unsafe.set obj (Js.string "request") (value_to_js request); + (* resume callback: clears __io_request, pushes nil, re-runs VM *) + Js.Unsafe.set obj (Js.string "resume") (Js.wrap_callback (fun _result_js -> + let resumed = Sx_vm_ref.resume_module (Dict d) in sync_vm_to_env (); - value_to_js v - with Sx_vm.VmSuspended (request, vm2) -> - handle_suspension request vm2 - -and handle_suspension request vm = - let op = match request with - | Dict d -> (match Hashtbl.find_opt d "op" with Some (String s) -> s | _ -> "") - | _ -> "" in - if op = "import" then - match handle_import_suspension request with - | Some result -> - (* Library already loaded — resume and handle further suspensions *) - resume_with_suspensions vm result - | None -> - (* Library not loaded — return suspension to JS for async fetch *) - Js.Unsafe.inject (make_js_suspension request (fun _result -> - resume_with_suspensions vm Nil)) - else - Js.Unsafe.inject (make_js_suspension request (fun result -> - resume_with_suspensions vm result)) + match resumed with + | Dict d2 when (match Hashtbl.find_opt d2 "suspended" with Some (Bool true) -> true | _ -> false) -> + Js.Unsafe.inject (make_js_import_suspension d2) + | result -> value_to_js result)); + obj let api_load_module module_js = try let code_val = js_to_value module_js in let code = Sx_vm.code_from_value code_val in - let _result = Sx_vm_ref.execute_module code _vm_globals in - sync_vm_to_env (); - Js.Unsafe.inject (Hashtbl.length _vm_globals) + let result = Sx_vm_ref.execute_module code _vm_globals in + match result with + | Dict d when (match Hashtbl.find_opt d "suspended" with Some (Bool true) -> true | _ -> false) -> + (* VM suspended on OP_PERFORM (import) — return JS suspension object *) + Js.Unsafe.inject (make_js_import_suspension d) + | _ -> + sync_vm_to_env (); + Js.Unsafe.inject (Hashtbl.length _vm_globals) with - | Sx_vm.VmSuspended (request, vm) -> - handle_suspension request vm | Eval_error msg -> Js.Unsafe.inject (Js.string ("Error: " ^ msg)) | exn -> Js.Unsafe.inject (Js.string ("Error: " ^ Printexc.to_string exn)) @@ -628,7 +620,7 @@ let () = in let module_val = convert_code code_form in let code = Sx_vm.code_from_value module_val in - let _result = Sx_vm_ref.execute_module code _vm_globals in + let _result = Sx_vm.execute_module code _vm_globals in sync_vm_to_env (); Number (float_of_int (Hashtbl.length _vm_globals)) | _ -> raise (Eval_error "load-sxbc: expected (sxbc version hash (code ...))")); diff --git a/hosts/ocaml/browser/test_wasm.sh b/hosts/ocaml/browser/test_wasm.sh index dd7dde3d..e8282cfe 100755 --- a/hosts/ocaml/browser/test_wasm.sh +++ b/hosts/ocaml/browser/test_wasm.sh @@ -95,7 +95,7 @@ node -e ' var K = globalThis.SxKernel; if (!K) { console.error("FAIL: SxKernel not found"); process.exit(1); } - // --- Register 8 FFI host primitives (normally done by sx-platform-2.js) --- + // --- Register 8 FFI host primitives (normally done by sx-platform.js) --- K.registerNative("host-global", function(args) { var name = args[0]; if (typeof globalThis !== "undefined" && name in globalThis) return globalThis[name]; @@ -195,7 +195,7 @@ node -e ' assert("is-html-tag? fake", K.eval("(is-html-tag? \"fake\")"), false); // ===================================================================== - // Load web stack modules (same as sx-platform-2.js loadWebStack) + // Load web stack modules (same as sx-platform.js loadWebStack) // ===================================================================== var fs = require("fs"); var webStackFiles = [ diff --git a/hosts/ocaml/lib/sx_vm.ml b/hosts/ocaml/lib/sx_vm.ml index 7d9904cf..24767b3e 100644 --- a/hosts/ocaml/lib/sx_vm.ml +++ b/hosts/ocaml/lib/sx_vm.ml @@ -598,6 +598,16 @@ let execute_module code globals = run vm; pop vm +(** Execute module, catching VmSuspended locally (same compilation unit). + Returns [Ok result] or [Error (request, vm)] for import suspension. + Needed because js_of_ocaml can't catch exceptions across module boundaries. *) +let execute_module_safe code globals = + try + let result = execute_module code globals in + Ok result + with VmSuspended (request, vm) -> + Error (request, vm) + (** {1 Lazy JIT compilation} *) diff --git a/hosts/ocaml/lib/sx_vm_ref.ml b/hosts/ocaml/lib/sx_vm_ref.ml index 9bb1506a..9cc303eb 100644 --- a/hosts/ocaml/lib/sx_vm_ref.ml +++ b/hosts/ocaml/lib/sx_vm_ref.ml @@ -455,7 +455,20 @@ let () = _vm_call_fn := vm_call Public API — matches Sx_vm interface for drop-in replacement ================================================================ *) -(** Execute a compiled module — entry point for load-sxbc, compile-blob. *) +(** Build a suspension dict from __io_request in globals. *) +let check_io_suspension globals vm_val = + match Hashtbl.find_opt globals "__io_request" with + | Some req when sx_truthy req -> + let d = Hashtbl.create 4 in + Hashtbl.replace d "suspended" (Bool true); + Hashtbl.replace d "op" (String "import"); + Hashtbl.replace d "request" req; + Hashtbl.replace d "vm" vm_val; + Some (Dict d) + | _ -> None + +(** Execute a compiled module — entry point for load-sxbc, compile-blob. + Returns the result value, or a suspension dict if OP_PERFORM fired. *) let execute_module (code : vm_code) (globals : (string, value) Hashtbl.t) = let cl = { vm_code = code; vm_upvalues = [||]; vm_name = Some "module"; vm_env_ref = globals; vm_closure_env = None } in @@ -468,7 +481,25 @@ let execute_module (code : vm_code) (globals : (string, value) Hashtbl.t) = done; m.vm_frames <- [frame]; ignore (vm_run vm_val); - vm_pop vm_val + match check_io_suspension globals vm_val with + | Some suspension -> suspension + | None -> vm_pop vm_val + +(** Resume a suspended module. Clears __io_request, pushes nil, re-runs. *) +let resume_module (suspended : value) = + match suspended with + | Dict d -> + let vm_val = Hashtbl.find d "vm" in + let globals = match vm_val with + | VmMachine m -> m.vm_globals + | _ -> raise (Eval_error "resume_module: expected VmMachine") in + Hashtbl.replace globals "__io_request" Nil; + ignore (vm_push vm_val Nil); + ignore (vm_run vm_val); + (match check_io_suspension globals vm_val with + | Some suspension -> suspension + | None -> vm_pop vm_val) + | _ -> raise (Eval_error "resume_module: expected suspension dict") (** Execute a closure with args — entry point for JIT Lambda calls. *) let call_closure (cl : vm_closure) (args : value list) (globals : (string, value) Hashtbl.t) = diff --git a/lib/compiler.sx b/lib/compiler.sx index 2f876bf5..404f2d71 100644 --- a/lib/compiler.sx +++ b/lib/compiler.sx @@ -15,7 +15,8 @@ ;; Constant pool builder ;; -------------------------------------------------------------------------- -(define-library (sx compiler) +(define-library + (sx compiler) (export make-pool pool-add @@ -60,867 +61,824 @@ compile compile-module) (begin - -(define make-pool (fn () {:entries (if (primitive? "mutable-list") (mutable-list) (list)) :index {:_count 0}})) - -(define - pool-add - (fn - (pool value) - "Add a value to the constant pool, return its index. Deduplicates." - (let - ((key (serialize value)) (idx-map (get pool "index"))) - (if - (has-key? idx-map key) - (get idx-map key) + (define make-pool (fn () {:entries (if (primitive? "mutable-list") (mutable-list) (list)) :index {:_count 0}})) + (define + pool-add + (fn + (pool value) + "Add a value to the constant pool, return its index. Deduplicates." (let - ((idx (get idx-map "_count"))) - (dict-set! idx-map key idx) - (dict-set! idx-map "_count" (+ idx 1)) - (append! (get pool "entries") value) - idx))))) - -;; -------------------------------------------------------------------------- -;; Scope analysis -;; -------------------------------------------------------------------------- -(define make-scope (fn (parent) {:next-slot 0 :upvalues (list) :locals (list) :parent parent :is-function false})) - -(define - scope-define-local - (fn - (scope name) - "Add a local variable, return its slot index.\n Idempotent: if name already has a slot, return it." - (let - ((existing (first (filter (fn (l) (= (get l "name") name)) (get scope "locals"))))) - (if - existing - (get existing "slot") + ((key (serialize value)) (idx-map (get pool "index"))) + (if + (has-key? idx-map key) + (get idx-map key) + (let + ((idx (get idx-map "_count"))) + (dict-set! idx-map key idx) + (dict-set! idx-map "_count" (+ idx 1)) + (append! (get pool "entries") value) + idx))))) + (define make-scope (fn (parent) {:next-slot 0 :upvalues (list) :locals (list) :parent parent :is-function false})) + (define + scope-define-local + (fn + (scope name) + "Add a local variable, return its slot index.\n Idempotent: if name already has a slot, return it." (let - ((slot (get scope "next-slot"))) - (append! (get scope "locals") {:mutable false :slot slot :name name}) - (dict-set! scope "next-slot" (+ slot 1)) - slot))))) - -(define - scope-resolve - (fn - (scope name) - "Resolve a variable name. Returns {:type \"local\"|\"upvalue\"|\"global\", :index N}.\n Upvalue captures only happen at function boundaries (is-function=true).\n Let scopes share the enclosing function's frame — their locals are\n accessed directly without upvalue indirection." - (if - (nil? scope) - {:index name :type "global"} - (let - ((locals (get scope "locals")) - (found (some (fn (l) (= (get l "name") name)) locals))) + ((existing (first (filter (fn (l) (= (get l "name") name)) (get scope "locals"))))) + (if + existing + (get existing "slot") + (let + ((slot (get scope "next-slot"))) + (append! (get scope "locals") {:mutable false :slot slot :name name}) + (dict-set! scope "next-slot" (+ slot 1)) + slot))))) + (define + scope-resolve + (fn + (scope name) + "Resolve a variable name. Returns {:type \"local\"|\"upvalue\"|\"global\", :index N}.\n Upvalue captures only happen at function boundaries (is-function=true).\n Let scopes share the enclosing function's frame — their locals are\n accessed directly without upvalue indirection." (if - found + (nil? scope) + {:index name :type "global"} (let - ((local (first (filter (fn (l) (= (get l "name") name)) locals)))) - {:index (get local "slot") :type "local"}) - (let - ((upvals (get scope "upvalues")) - (uv-found (some (fn (u) (= (get u "name") name)) upvals))) + ((locals (get scope "locals")) + (found (some (fn (l) (= (get l "name") name)) locals))) (if - uv-found + found (let - ((uv (first (filter (fn (u) (= (get u "name") name)) upvals)))) - {:index (get uv "uv-index") :type "upvalue"}) + ((local (first (filter (fn (l) (= (get l "name") name)) locals)))) + {:index (get local "slot") :type "local"}) (let - ((parent (get scope "parent"))) + ((upvals (get scope "upvalues")) + (uv-found + (some (fn (u) (= (get u "name") name)) upvals))) (if - (nil? parent) - {:index name :type "global"} + uv-found (let - ((parent-result (scope-resolve parent name))) + ((uv (first (filter (fn (u) (= (get u "name") name)) upvals)))) + {:index (get uv "uv-index") :type "upvalue"}) + (let + ((parent (get scope "parent"))) (if - (= (get parent-result "type") "global") - parent-result - (if - (get scope "is-function") - (let - ((uv-idx (len (get scope "upvalues")))) - (append! (get scope "upvalues") {:index (get parent-result "index") :is-local (= (get parent-result "type") "local") :uv-index uv-idx :name name}) - {:index uv-idx :type "upvalue"}) - parent-result)))))))))))) - -;; -------------------------------------------------------------------------- -;; Code emitter -;; -------------------------------------------------------------------------- -(define make-emitter (fn () {:pool (make-pool) :bytecode (if (primitive? "mutable-list") (mutable-list) (list))})) - -(define emit-byte (fn (em byte) (append! (get em "bytecode") byte))) - -(define - emit-u16 - (fn - (em value) - (emit-byte em (mod value 256)) - (emit-byte em (mod (floor (/ value 256)) 256)))) - -(define - emit-i16 - (fn - (em value) - (let ((v (if (< value 0) (+ value 65536) value))) (emit-u16 em v)))) - -(define emit-op (fn (em opcode) (emit-byte em opcode))) - -(define - emit-const - (fn - (em value) - (let - ((idx (pool-add (get em "pool") value))) - (emit-op em 1) - (emit-u16 em idx)))) - -(define current-offset (fn (em) (len (get em "bytecode")))) - -(define - patch-i16 - (fn - (em offset value) - "Patch a previously emitted i16 at the given bytecode offset." - (let - ((v (if (< value 0) (+ value 65536) value)) - (bc (get em "bytecode"))) - (set-nth! bc offset (mod v 256)) - (set-nth! bc (+ offset 1) (mod (floor (/ v 256)) 256))))) - -;; -------------------------------------------------------------------------- -;; Compilation — expression dispatch -;; -------------------------------------------------------------------------- -(define - compile-expr - (fn - (em expr scope tail?) - "Compile an expression. tail? indicates tail position for TCO." - (cond - (nil? expr) - (emit-op em 2) - (= (type-of expr) "number") - (emit-const em expr) - (= (type-of expr) "string") - (emit-const em expr) - (= (type-of expr) "boolean") - (emit-op em (if expr 3 4)) - (= (type-of expr) "keyword") - (emit-const em (keyword-name expr)) - (= (type-of expr) "symbol") - (compile-symbol em (symbol-name expr) scope) - (= (type-of expr) "list") - (if - (empty? expr) - (do (emit-op em 64) (emit-u16 em 0)) - (compile-list em expr scope tail?)) - (= (type-of expr) "dict") - (compile-dict em expr scope) - :else (emit-const em expr)))) - -(define - compile-symbol - (fn - (em name scope) - (let - ((resolved (scope-resolve scope name))) - (cond - (= (get resolved "type") "local") - (do (emit-op em 16) (emit-byte em (get resolved "index"))) - (= (get resolved "type") "upvalue") - (do (emit-op em 18) (emit-byte em (get resolved "index"))) - :else (let - ((idx (pool-add (get em "pool") name))) - (emit-op em 20) - (emit-u16 em idx)))))) - -(define - compile-dict - (fn - (em expr scope) - (let - ((ks (keys expr)) (count (len ks))) - (for-each - (fn - (k) - (emit-const em k) - (compile-expr em (get expr k) scope false)) - ks) - (emit-op em 65) - (emit-u16 em count)))) - -;; -------------------------------------------------------------------------- -;; List compilation — special forms, calls -;; -------------------------------------------------------------------------- -(define - compile-list - (fn - (em expr scope tail?) - (let - ((head (first expr)) (args (rest expr))) - (if - (not (= (type-of head) "symbol")) - (compile-call em head args scope tail?) + (nil? parent) + {:index name :type "global"} + (let + ((parent-result (scope-resolve parent name))) + (if + (= (get parent-result "type") "global") + parent-result + (if + (get scope "is-function") + (let + ((uv-idx (len (get scope "upvalues")))) + (append! (get scope "upvalues") {:index (get parent-result "index") :is-local (= (get parent-result "type") "local") :uv-index uv-idx :name name}) + {:index uv-idx :type "upvalue"}) + parent-result)))))))))))) + (define make-emitter (fn () {:pool (make-pool) :bytecode (if (primitive? "mutable-list") (mutable-list) (list))})) + (define emit-byte (fn (em byte) (append! (get em "bytecode") byte))) + (define + emit-u16 + (fn + (em value) + (emit-byte em (mod value 256)) + (emit-byte em (mod (floor (/ value 256)) 256)))) + (define + emit-i16 + (fn + (em value) (let - ((name (symbol-name head))) - (cond - (= name "if") - (compile-if em args scope tail?) - (= name "when") - (compile-when em args scope tail?) - (= name "and") - (compile-and em args scope tail?) - (= name "or") - (compile-or em args scope tail?) - (= name "let") - (compile-let em args scope tail?) - (= name "let*") - (compile-let em args scope tail?) - (= name "begin") - (compile-begin em args scope tail?) - (= name "do") - (compile-begin em args scope tail?) - (= name "lambda") - (compile-lambda em args scope) - (= name "fn") - (compile-lambda em args scope) - (= name "define") - (compile-define em args scope) - (= name "set!") - (compile-set em args scope) - (= name "quote") - (compile-quote em args) - (= name "cond") - (compile-cond em args scope tail?) - (= name "case") - (compile-case em args scope tail?) - (= name "->") - (compile-thread em args scope tail?) - (= name "defcomp") - (compile-defcomp em args scope) - (= name "defisland") - (compile-defcomp em args scope) - (= name "defmacro") - (compile-defmacro em args scope) - (= name "defstyle") - (do (emit-op em 2) nil) - (= name "defhandler") - (do (emit-op em 2) nil) - (= name "defpage") - (do (emit-op em 2) nil) - (= name "defquery") - (do (emit-op em 2) nil) - (= name "defaction") - (do (emit-op em 2) nil) - (= name "defrelation") - (do (emit-op em 2) nil) - (= name "deftype") - (do (emit-op em 2) nil) - (= name "defeffect") - (do (emit-op em 2) nil) - (= name "defisland") - (compile-defcomp em args scope) - (= name "quasiquote") - (compile-quasiquote em (first args) scope) - (= name "letrec") - (compile-letrec em args scope tail?) - (= name "match") - (compile-match em args scope tail?) - (= name "perform") - (let - () - (compile-expr em (first args) scope false) - (emit-op em 112) - nil) - :else (compile-call em head args scope tail?))))))) - -;; -------------------------------------------------------------------------- -;; Special form compilation -;; -------------------------------------------------------------------------- -(define - compile-if - (fn - (em args scope tail?) - (let - ((test (first args)) - (then-expr (nth args 1)) - (else-expr (if (> (len args) 2) (nth args 2) nil))) - (compile-expr em test scope false) - (emit-op em 33) - (let - ((else-jump (current-offset em))) - (emit-i16 em 0) - (compile-expr em then-expr scope tail?) - (emit-op em 32) + ((v (if (< value 0) (+ value 65536) value))) + (emit-u16 em v)))) + (define emit-op (fn (em opcode) (emit-byte em opcode))) + (define + emit-const + (fn + (em value) (let - ((end-jump (current-offset em))) - (emit-i16 em 0) - (patch-i16 em else-jump (- (current-offset em) (+ else-jump 2))) - (if - (nil? else-expr) - (emit-op em 2) - (compile-expr em else-expr scope tail?)) - (patch-i16 em end-jump (- (current-offset em) (+ end-jump 2)))))))) - -(define - compile-when - (fn - (em args scope tail?) - (let - ((test (first args)) (body (rest args))) - (compile-expr em test scope false) - (emit-op em 33) - (let - ((skip-jump (current-offset em))) - (emit-i16 em 0) - (compile-begin em body scope tail?) - (emit-op em 32) + ((idx (pool-add (get em "pool") value))) + (emit-op em 1) + (emit-u16 em idx)))) + (define current-offset (fn (em) (len (get em "bytecode")))) + (define + patch-i16 + (fn + (em offset value) + "Patch a previously emitted i16 at the given bytecode offset." (let - ((end-jump (current-offset em))) - (emit-i16 em 0) - (patch-i16 em skip-jump (- (current-offset em) (+ skip-jump 2))) + ((v (if (< value 0) (+ value 65536) value)) + (bc (get em "bytecode"))) + (set-nth! bc offset (mod v 256)) + (set-nth! bc (+ offset 1) (mod (floor (/ v 256)) 256))))) + (define + compile-expr + (fn + (em expr scope tail?) + "Compile an expression. tail? indicates tail position for TCO." + (cond + (nil? expr) (emit-op em 2) - (patch-i16 em end-jump (- (current-offset em) (+ end-jump 2)))))))) - -(define - compile-and - (fn - (em args scope tail?) - (if - (empty? args) - (emit-op em 3) - (if - (= (len args) 1) - (compile-expr em (first args) scope tail?) - (do - (compile-expr em (first args) scope false) - (emit-op em 6) - (emit-op em 33) - (let - ((skip (current-offset em))) - (emit-i16 em 0) - (emit-op em 5) - (compile-and em (rest args) scope tail?) - (patch-i16 em skip (- (current-offset em) (+ skip 2))))))))) - -(define - compile-or - (fn - (em args scope tail?) - (if - (empty? args) - (emit-op em 4) - (if - (= (len args) 1) - (compile-expr em (first args) scope tail?) - (do - (compile-expr em (first args) scope false) - (emit-op em 6) - (emit-op em 34) - (let - ((skip (current-offset em))) - (emit-i16 em 0) - (emit-op em 5) - (compile-or em (rest args) scope tail?) - (patch-i16 em skip (- (current-offset em) (+ skip 2))))))))) - -(define - compile-begin - (fn - (em exprs scope tail?) - (when - (and (not (empty? exprs)) (not (nil? (get scope "parent")))) - (for-each - (fn - (expr) - (when - (and - (= (type-of expr) "list") - (>= (len expr) 2) - (= (type-of (first expr)) "symbol") - (= (symbol-name (first expr)) "define")) - (let - ((name-expr (nth expr 1)) - (name - (if - (= (type-of name-expr) "symbol") - (symbol-name name-expr) - name-expr))) - (scope-define-local scope name)))) - exprs)) - (if - (empty? exprs) - (emit-op em 2) - (if - (= (len exprs) 1) - (compile-expr em (first exprs) scope tail?) - (do - (compile-expr em (first exprs) scope false) - (emit-op em 5) - (compile-begin em (rest exprs) scope tail?)))))) - -(define - compile-let - (fn - (em args scope tail?) - (if - (= (type-of (first args)) "symbol") - (let - ((loop-name (symbol-name (first args))) - (bindings (nth args 1)) - (body (slice args 2)) - (params (list)) - (inits (list))) - (for-each - (fn - (binding) - (append! - params - (if - (= (type-of (first binding)) "symbol") - (first binding) - (make-symbol (first binding)))) - (append! inits (nth binding 1))) - bindings) - (let - ((lambda-expr (concat (list (make-symbol "fn") params) body)) - (letrec-bindings - (list (list (make-symbol loop-name) lambda-expr))) - (call-expr (cons (make-symbol loop-name) inits))) - (compile-letrec em (list letrec-bindings call-expr) scope tail?))) - (let - ((bindings (first args)) - (body (rest args)) - (let-scope (make-scope scope))) - (dict-set! let-scope "next-slot" (get scope "next-slot")) - (for-each - (fn - (binding) - (let - ((name (if (= (type-of (first binding)) "symbol") (symbol-name (first binding)) (first binding))) - (value (nth binding 1)) - (slot (scope-define-local let-scope name))) - (compile-expr em value let-scope false) - (emit-op em 17) - (emit-byte em slot))) - bindings) - (compile-begin em body let-scope tail?))))) - -(define - compile-letrec - (fn - (em args scope tail?) - "Compile letrec: all names visible during value compilation.\n 1. Define all local slots (initialized to nil).\n 2. Compile each value and assign — names are already in scope\n so mutually recursive functions can reference each other." - (let - ((bindings (first args)) - (body (rest args)) - (let-scope (make-scope scope))) - (dict-set! let-scope "next-slot" (get scope "next-slot")) - (let - ((slots (map (fn (binding) (let ((name (if (= (type-of (first binding)) "symbol") (symbol-name (first binding)) (first binding)))) (let ((slot (scope-define-local let-scope name))) (emit-op em 2) (emit-op em 17) (emit-byte em slot) slot))) bindings))) - (for-each - (fn - (pair) - (let - ((binding (first pair)) (slot (nth pair 1))) - (compile-expr em (nth binding 1) let-scope false) - (emit-op em 17) - (emit-byte em slot))) - (map - (fn (i) (list (nth bindings i) (nth slots i))) - (range 0 (len bindings))))) - (compile-begin em body let-scope tail?)))) - -(define - compile-lambda - (fn - (em args scope) - (let - ((params (first args)) - (body (rest args)) - (fn-scope (make-scope scope)) - (fn-em (make-emitter))) - (dict-set! fn-scope "is-function" true) - (for-each - (fn - (p) - (let - ((name (cond (= (type-of p) "symbol") (symbol-name p) (and (list? p) (not (empty? p)) (= (type-of (first p)) "symbol")) (symbol-name (first p)) :else p))) - (when - (and (not (= name "&key")) (not (= name "&rest"))) - (scope-define-local fn-scope name)))) - params) - (compile-begin fn-em body fn-scope true) - (emit-op fn-em 50) - (let - ((upvals (get fn-scope "upvalues")) - (code {:upvalue-count (len upvals) :arity (len (get fn-scope "locals")) :constants (get (get fn-em "pool") "entries") :bytecode (get fn-em "bytecode")}) - (code-idx (pool-add (get em "pool") code))) - (emit-op em 51) - (emit-u16 em code-idx) - (for-each - (fn - (uv) - (emit-byte em (if (get uv "is-local") 1 0)) - (emit-byte em (get uv "index"))) - upvals))))) - -(define - compile-define - (fn - (em args scope) - (let - ((name-expr (first args)) - (name + (= (type-of expr) "number") + (emit-const em expr) + (= (type-of expr) "string") + (emit-const em expr) + (= (type-of expr) "boolean") + (emit-op em (if expr 3 4)) + (= (type-of expr) "keyword") + (emit-const em (keyword-name expr)) + (= (type-of expr) "symbol") + (compile-symbol em (symbol-name expr) scope) + (= (type-of expr) "list") (if - (= (type-of name-expr) "symbol") - (symbol-name name-expr) - name-expr)) - (value - (let - ((rest-args (rest args))) - (if - (and - (not (empty? rest-args)) - (= (type-of (first rest-args)) "keyword")) - (let - ((skip-annotations (fn (items) (if (empty? items) nil (if (= (type-of (first items)) "keyword") (skip-annotations (rest (rest items))) (first items)))))) - (skip-annotations rest-args)) - (first rest-args))))) - (if - (not (nil? (get scope "parent"))) + (empty? expr) + (do (emit-op em 64) (emit-u16 em 0)) + (compile-list em expr scope tail?)) + (= (type-of expr) "dict") + (compile-dict em expr scope) + :else (emit-const em expr)))) + (define + compile-symbol + (fn + (em name scope) (let - ((slot (scope-define-local scope name))) - (compile-expr em value scope false) - (emit-op em 17) - (emit-byte em slot)) + ((resolved (scope-resolve scope name))) + (cond + (= (get resolved "type") "local") + (do (emit-op em 16) (emit-byte em (get resolved "index"))) + (= (get resolved "type") "upvalue") + (do (emit-op em 18) (emit-byte em (get resolved "index"))) + :else (let + ((idx (pool-add (get em "pool") name))) + (emit-op em 20) + (emit-u16 em idx)))))) + (define + compile-dict + (fn + (em expr scope) (let - ((name-idx (pool-add (get em "pool") name))) - (compile-expr em value scope false) - (emit-op em 128) - (emit-u16 em name-idx)))))) - -(define - compile-set - (fn - (em args scope) - (let - ((name (if (= (type-of (first args)) "symbol") (symbol-name (first args)) (first args))) - (value (nth args 1)) - (resolved (scope-resolve scope name))) - (compile-expr em value scope false) - (cond - (= (get resolved "type") "local") - (do (emit-op em 17) (emit-byte em (get resolved "index"))) - (= (get resolved "type") "upvalue") - (do (emit-op em 19) (emit-byte em (get resolved "index"))) - :else (let - ((idx (pool-add (get em "pool") name))) - (emit-op em 21) - (emit-u16 em idx)))))) - -(define - compile-quote - (fn - (em args) - (if (empty? args) (emit-op em 2) (emit-const em (first args))))) - -(define - compile-cond - (fn - (em args scope tail?) - "Compile (cond test1 body1 test2 body2 ... :else fallback)." - (if - (< (len args) 2) - (emit-op em 2) - (let - ((test (first args)) - (body (nth args 1)) - (rest-clauses (if (> (len args) 2) (slice args 2) (list)))) - (if - (or - (and - (= (type-of test) "keyword") - (= (keyword-name test) "else")) - (= test true)) - (compile-expr em body scope tail?) - (do - (compile-expr em test scope false) - (emit-op em 33) - (let - ((skip (current-offset em))) - (emit-i16 em 0) - (compile-expr em body scope tail?) - (emit-op em 32) - (let - ((end-jump (current-offset em))) - (emit-i16 em 0) - (patch-i16 em skip (- (current-offset em) (+ skip 2))) - (compile-cond em rest-clauses scope tail?) - (patch-i16 - em - end-jump - (- (current-offset em) (+ end-jump 2))))))))))) - -(define - compile-case - (fn - (em args scope tail?) - "Compile (case expr val1 body1 val2 body2 ... :else fallback)." - (compile-expr em (first args) scope false) - (let - ((clauses (rest args))) - (compile-case-clauses em clauses scope tail?)))) - -(define - compile-case-clauses - (fn - (em clauses scope tail?) - (if - (< (len clauses) 2) - (do (emit-op em 5) (emit-op em 2)) - (let - ((test (first clauses)) - (body (nth clauses 1)) - (rest-clauses (if (> (len clauses) 2) (slice clauses 2) (list)))) - (if - (or - (and - (= (type-of test) "keyword") - (= (keyword-name test) "else")) - (= test true)) - (do (emit-op em 5) (compile-expr em body scope tail?)) - (do - (emit-op em 6) - (compile-expr em test scope false) - (let - ((name-idx (pool-add (get em "pool") "="))) - (emit-op em 52) - (emit-u16 em name-idx) - (emit-byte em 2)) - (emit-op em 33) - (let - ((skip (current-offset em))) - (emit-i16 em 0) - (emit-op em 5) - (compile-expr em body scope tail?) - (emit-op em 32) - (let - ((end-jump (current-offset em))) - (emit-i16 em 0) - (patch-i16 em skip (- (current-offset em) (+ skip 2))) - (compile-case-clauses em rest-clauses scope tail?) - (patch-i16 - em - end-jump - (- (current-offset em) (+ end-jump 2))))))))))) - -;; compile-match — compile (match expr (pattern body) ...) to bytecode. -;; Self-contained via letrec so JIT can find the recursive helper. -(define - compile-match - (fn - (em args scope tail?) - (compile-expr em (first args) scope false) - (letrec - ((do-clauses (fn (clauses) (if (empty? clauses) (do (emit-op em 5) (let ((idx (pool-add (get em "pool") "match: no clause matched"))) (emit-op em 1) (emit-u16 em idx) (emit-op em 52) (emit-u16 em (pool-add (get em "pool") "error")) (emit-byte em 1))) (let ((clause (first clauses)) (pattern (first clause)) (body (nth clause 1)) (rest-clauses (rest clauses))) (cond (and (= (type-of pattern) "symbol") (= (symbol-name pattern) "_")) (do (emit-op em 5) (compile-expr em body scope tail?)) (and (= (type-of pattern) "symbol") (not (= (symbol-name pattern) "true")) (not (= (symbol-name pattern) "false")) (not (= (symbol-name pattern) "nil"))) (let ((var-name (symbol-name pattern)) (inner-scope (scope-add scope var-name))) (emit-op em 13) (emit-byte em (scope-index inner-scope var-name)) (compile-expr em body inner-scope tail?)) (and (list? pattern) (= (len pattern) 2) (= (type-of (first pattern)) "symbol") (= (symbol-name (first pattern)) "quote") (= (type-of (nth pattern 1)) "symbol")) (do (emit-op em 6) (let ((idx (pool-add (get em "pool") (make-symbol (symbol-name (nth pattern 1)))))) (emit-op em 1) (emit-u16 em idx)) (let ((eq-idx (pool-add (get em "pool") "="))) (emit-op em 52) (emit-u16 em eq-idx) (emit-byte em 2)) (emit-op em 33) (let ((skip (current-offset em))) (emit-i16 em 0) (emit-op em 5) (compile-expr em body scope tail?) (emit-op em 32) (let ((end-jump (current-offset em))) (emit-i16 em 0) (patch-i16 em skip (- (current-offset em) (+ skip 2))) (do-clauses rest-clauses) (patch-i16 em end-jump (- (current-offset em) (+ end-jump 2)))))) :else (do (emit-op em 6) (compile-expr em pattern scope false) (let ((eq-idx (pool-add (get em "pool") "="))) (emit-op em 52) (emit-u16 em eq-idx) (emit-byte em 2)) (emit-op em 33) (let ((skip (current-offset em))) (emit-i16 em 0) (emit-op em 5) (compile-expr em body scope tail?) (emit-op em 32) (let ((end-jump (current-offset em))) (emit-i16 em 0) (patch-i16 em skip (- (current-offset em) (+ skip 2))) (do-clauses rest-clauses) (patch-i16 em end-jump (- (current-offset em) (+ end-jump 2)))))))))))) - (do-clauses (rest args))))) - -(define - compile-thread - (fn - (em args scope tail?) - "Compile (-> val (f1 a) (f2 b)) by desugaring to nested calls." - (if - (empty? args) - (emit-op em 2) - (if - (= (len args) 1) - (compile-expr em (first args) scope tail?) - (let - ((val-expr (first args)) (forms (rest args))) - (compile-thread-step em val-expr forms scope tail?)))))) - -(define - compile-thread-step - (fn - (em val-expr forms scope tail?) - (if - (empty? forms) - (compile-expr em val-expr scope tail?) - (let - ((form (first forms)) - (rest-forms (rest forms)) - (is-tail (and tail? (empty? rest-forms)))) - (let - ((call-expr (if (list? form) (concat (list (first form) val-expr) (rest form)) (list form val-expr)))) - (if - (empty? rest-forms) - (compile-expr em call-expr scope is-tail) - (do - (compile-expr em call-expr scope false) - (compile-thread-step em call-expr rest-forms scope tail?)))))))) - -(define - compile-defcomp - (fn - (em args scope) - "Compile defcomp/defisland — delegates to runtime via GLOBAL_GET + CALL." - (let - ((name-idx (pool-add (get em "pool") "eval-defcomp"))) - (emit-op em 20) - (emit-u16 em name-idx)) - (emit-const em (concat (list (make-symbol "defcomp")) args)) - (emit-op em 48) - (emit-byte em 1))) - -;; CALL 1 -(define - compile-defmacro - (fn - (em args scope) - "Compile defmacro — delegates to runtime via GLOBAL_GET + CALL." - (let - ((name-idx (pool-add (get em "pool") "eval-defmacro"))) - (emit-op em 20) - (emit-u16 em name-idx)) - (emit-const em (concat (list (make-symbol "defmacro")) args)) - (emit-op em 48) - (emit-byte em 1))) - -(define - compile-quasiquote - (fn - (em expr scope) - "Compile quasiquote inline — walks the template at compile time,\n emitting code that builds the structure at runtime. Unquoted\n expressions are compiled normally (resolving locals/upvalues),\n avoiding the qq-expand-runtime env-lookup limitation." - (compile-qq-expr em expr scope))) - -(define - compile-qq-expr - (fn - (em expr scope) - "Compile a quasiquote sub-expression." - (if - (not (= (type-of expr) "list")) - (emit-const em expr) - (if - (empty? expr) - (do (emit-op em 64) (emit-u16 em 0)) - (let - ((head (first expr))) - (if - (and - (= (type-of head) "symbol") - (= (symbol-name head) "unquote")) - (compile-expr em (nth expr 1) scope false) - (compile-qq-list em expr scope))))))) - -(define - compile-qq-list - (fn - (em items scope) - "Compile a quasiquote list. Handles splice-unquote by building\n segments and concatenating them." - (let - ((has-splice (some (fn (item) (and (= (type-of item) "list") (>= (len item) 2) (= (type-of (first item)) "symbol") (= (symbol-name (first item)) "splice-unquote"))) items))) - (if - (not has-splice) - (do - (for-each (fn (item) (compile-qq-expr em item scope)) items) - (emit-op em 64) - (emit-u16 em (len items))) - (let - ((segment-count 0) (pending 0)) + ((ks (keys expr)) (count (len ks))) (for-each (fn - (item) + (k) + (emit-const em k) + (compile-expr em (get expr k) scope false)) + ks) + (emit-op em 65) + (emit-u16 em count)))) + (define + compile-list + (fn + (em expr scope tail?) + (let + ((head (first expr)) (args (rest expr))) + (if + (not (= (type-of head) "symbol")) + (compile-call em head args scope tail?) + (let + ((name (symbol-name head))) + (cond + (= name "if") + (compile-if em args scope tail?) + (= name "when") + (compile-when em args scope tail?) + (= name "and") + (compile-and em args scope tail?) + (= name "or") + (compile-or em args scope tail?) + (= name "let") + (compile-let em args scope tail?) + (= name "let*") + (compile-let em args scope tail?) + (= name "begin") + (compile-begin em args scope tail?) + (= name "do") + (compile-begin em args scope tail?) + (= name "lambda") + (compile-lambda em args scope) + (= name "fn") + (compile-lambda em args scope) + (= name "define") + (compile-define em args scope) + (= name "set!") + (compile-set em args scope) + (= name "quote") + (compile-quote em args) + (= name "cond") + (compile-cond em args scope tail?) + (= name "case") + (compile-case em args scope tail?) + (= name "->") + (compile-thread em args scope tail?) + (= name "defcomp") + (compile-defcomp em args scope) + (= name "defisland") + (compile-defcomp em args scope) + (= name "defmacro") + (compile-defmacro em args scope) + (= name "defstyle") + (do (emit-op em 2) nil) + (= name "defhandler") + (do (emit-op em 2) nil) + (= name "defpage") + (do (emit-op em 2) nil) + (= name "defquery") + (do (emit-op em 2) nil) + (= name "defaction") + (do (emit-op em 2) nil) + (= name "defrelation") + (do (emit-op em 2) nil) + (= name "deftype") + (do (emit-op em 2) nil) + (= name "defeffect") + (do (emit-op em 2) nil) + (= name "defisland") + (compile-defcomp em args scope) + (= name "quasiquote") + (compile-quasiquote em (first args) scope) + (= name "letrec") + (compile-letrec em args scope tail?) + (= name "match") + (compile-match em args scope tail?) + (= name "perform") + (let + () + (compile-expr em (first args) scope false) + (emit-op em 112) + nil) + (= name "import") + (let () (emit-const em {:library (first args) :op "import"}) (emit-op em 112) nil) + (= name "define-library") + (let + ((body (filter (fn (a) (and (list? a) (not (empty? a)) (= (first a) (quote begin)))) args))) + (when + (not (empty? body)) + (let + ((forms (rest (first body)))) + (for-each + (fn + (expr) + (compile-expr em expr scope false) + (emit-op em 5)) + (init forms)) + (compile-expr em (last forms) scope false)))) + :else (compile-call em head args scope tail?))))))) + (define + compile-if + (fn + (em args scope tail?) + (let + ((test (first args)) + (then-expr (nth args 1)) + (else-expr (if (> (len args) 2) (nth args 2) nil))) + (compile-expr em test scope false) + (emit-op em 33) + (let + ((else-jump (current-offset em))) + (emit-i16 em 0) + (compile-expr em then-expr scope tail?) + (emit-op em 32) + (let + ((end-jump (current-offset em))) + (emit-i16 em 0) + (patch-i16 + em + else-jump + (- (current-offset em) (+ else-jump 2))) + (if + (nil? else-expr) + (emit-op em 2) + (compile-expr em else-expr scope tail?)) + (patch-i16 em end-jump (- (current-offset em) (+ end-jump 2)))))))) + (define + compile-when + (fn + (em args scope tail?) + (let + ((test (first args)) (body (rest args))) + (compile-expr em test scope false) + (emit-op em 33) + (let + ((skip-jump (current-offset em))) + (emit-i16 em 0) + (compile-begin em body scope tail?) + (emit-op em 32) + (let + ((end-jump (current-offset em))) + (emit-i16 em 0) + (patch-i16 + em + skip-jump + (- (current-offset em) (+ skip-jump 2))) + (emit-op em 2) + (patch-i16 em end-jump (- (current-offset em) (+ end-jump 2)))))))) + (define + compile-and + (fn + (em args scope tail?) + (if + (empty? args) + (emit-op em 3) + (if + (= (len args) 1) + (compile-expr em (first args) scope tail?) + (do + (compile-expr em (first args) scope false) + (emit-op em 6) + (emit-op em 33) + (let + ((skip (current-offset em))) + (emit-i16 em 0) + (emit-op em 5) + (compile-and em (rest args) scope tail?) + (patch-i16 em skip (- (current-offset em) (+ skip 2))))))))) + (define + compile-or + (fn + (em args scope tail?) + (if + (empty? args) + (emit-op em 4) + (if + (= (len args) 1) + (compile-expr em (first args) scope tail?) + (do + (compile-expr em (first args) scope false) + (emit-op em 6) + (emit-op em 34) + (let + ((skip (current-offset em))) + (emit-i16 em 0) + (emit-op em 5) + (compile-or em (rest args) scope tail?) + (patch-i16 em skip (- (current-offset em) (+ skip 2))))))))) + (define + compile-begin + (fn + (em exprs scope tail?) + (when + (and (not (empty? exprs)) (not (nil? (get scope "parent")))) + (for-each + (fn + (expr) + (when + (and + (= (type-of expr) "list") + (>= (len expr) 2) + (= (type-of (first expr)) "symbol") + (= (symbol-name (first expr)) "define")) + (let + ((name-expr (nth expr 1)) + (name + (if + (= (type-of name-expr) "symbol") + (symbol-name name-expr) + name-expr))) + (scope-define-local scope name)))) + exprs)) + (if + (empty? exprs) + (emit-op em 2) + (if + (= (len exprs) 1) + (compile-expr em (first exprs) scope tail?) + (do + (compile-expr em (first exprs) scope false) + (emit-op em 5) + (compile-begin em (rest exprs) scope tail?)))))) + (define + compile-let + (fn + (em args scope tail?) + (if + (= (type-of (first args)) "symbol") + (let + ((loop-name (symbol-name (first args))) + (bindings (nth args 1)) + (body (slice args 2)) + (params (list)) + (inits (list))) + (for-each + (fn + (binding) + (append! + params + (if + (= (type-of (first binding)) "symbol") + (first binding) + (make-symbol (first binding)))) + (append! inits (nth binding 1))) + bindings) + (let + ((lambda-expr (concat (list (make-symbol "fn") params) body)) + (letrec-bindings + (list (list (make-symbol loop-name) lambda-expr))) + (call-expr (cons (make-symbol loop-name) inits))) + (compile-letrec em (list letrec-bindings call-expr) scope tail?))) + (let + ((bindings (first args)) + (body (rest args)) + (let-scope (make-scope scope))) + (dict-set! let-scope "next-slot" (get scope "next-slot")) + (for-each + (fn + (binding) + (let + ((name (if (= (type-of (first binding)) "symbol") (symbol-name (first binding)) (first binding))) + (value (nth binding 1)) + (slot (scope-define-local let-scope name))) + (compile-expr em value let-scope false) + (emit-op em 17) + (emit-byte em slot))) + bindings) + (compile-begin em body let-scope tail?))))) + (define + compile-letrec + (fn + (em args scope tail?) + "Compile letrec: all names visible during value compilation.\n 1. Define all local slots (initialized to nil).\n 2. Compile each value and assign — names are already in scope\n so mutually recursive functions can reference each other." + (let + ((bindings (first args)) + (body (rest args)) + (let-scope (make-scope scope))) + (dict-set! let-scope "next-slot" (get scope "next-slot")) + (let + ((slots (map (fn (binding) (let ((name (if (= (type-of (first binding)) "symbol") (symbol-name (first binding)) (first binding)))) (let ((slot (scope-define-local let-scope name))) (emit-op em 2) (emit-op em 17) (emit-byte em slot) slot))) bindings))) + (for-each + (fn + (pair) + (let + ((binding (first pair)) (slot (nth pair 1))) + (compile-expr em (nth binding 1) let-scope false) + (emit-op em 17) + (emit-byte em slot))) + (map + (fn (i) (list (nth bindings i) (nth slots i))) + (range 0 (len bindings))))) + (compile-begin em body let-scope tail?)))) + (define + compile-lambda + (fn + (em args scope) + (let + ((params (first args)) + (body (rest args)) + (fn-scope (make-scope scope)) + (fn-em (make-emitter))) + (dict-set! fn-scope "is-function" true) + (for-each + (fn + (p) + (let + ((name (cond (= (type-of p) "symbol") (symbol-name p) (and (list? p) (not (empty? p)) (= (type-of (first p)) "symbol")) (symbol-name (first p)) :else p))) + (when + (and (not (= name "&key")) (not (= name "&rest"))) + (scope-define-local fn-scope name)))) + params) + (compile-begin fn-em body fn-scope true) + (emit-op fn-em 50) + (let + ((upvals (get fn-scope "upvalues")) + (code {:upvalue-count (len upvals) :arity (len (get fn-scope "locals")) :constants (get (get fn-em "pool") "entries") :bytecode (get fn-em "bytecode")}) + (code-idx (pool-add (get em "pool") code))) + (emit-op em 51) + (emit-u16 em code-idx) + (for-each + (fn + (uv) + (emit-byte em (if (get uv "is-local") 1 0)) + (emit-byte em (get uv "index"))) + upvals))))) + (define + compile-define + (fn + (em args scope) + (let + ((name-expr (first args)) + (name + (if + (= (type-of name-expr) "symbol") + (symbol-name name-expr) + name-expr)) + (value + (let + ((rest-args (rest args))) + (if + (and + (not (empty? rest-args)) + (= (type-of (first rest-args)) "keyword")) + (let + ((skip-annotations (fn (items) (if (empty? items) nil (if (= (type-of (first items)) "keyword") (skip-annotations (rest (rest items))) (first items)))))) + (skip-annotations rest-args)) + (first rest-args))))) + (if + (not (nil? (get scope "parent"))) + (let + ((slot (scope-define-local scope name))) + (compile-expr em value scope false) + (emit-op em 17) + (emit-byte em slot)) + (let + ((name-idx (pool-add (get em "pool") name))) + (compile-expr em value scope false) + (emit-op em 128) + (emit-u16 em name-idx)))))) + (define + compile-set + (fn + (em args scope) + (let + ((name (if (= (type-of (first args)) "symbol") (symbol-name (first args)) (first args))) + (value (nth args 1)) + (resolved (scope-resolve scope name))) + (compile-expr em value scope false) + (cond + (= (get resolved "type") "local") + (do (emit-op em 17) (emit-byte em (get resolved "index"))) + (= (get resolved "type") "upvalue") + (do (emit-op em 19) (emit-byte em (get resolved "index"))) + :else (let + ((idx (pool-add (get em "pool") name))) + (emit-op em 21) + (emit-u16 em idx)))))) + (define + compile-quote + (fn + (em args) + (if (empty? args) (emit-op em 2) (emit-const em (first args))))) + (define + compile-cond + (fn + (em args scope tail?) + "Compile (cond test1 body1 test2 body2 ... :else fallback)." + (if + (< (len args) 2) + (emit-op em 2) + (let + ((test (first args)) + (body (nth args 1)) + (rest-clauses (if (> (len args) 2) (slice args 2) (list)))) + (if + (or + (and + (= (type-of test) "keyword") + (= (keyword-name test) "else")) + (= test true)) + (compile-expr em body scope tail?) + (do + (compile-expr em test scope false) + (emit-op em 33) + (let + ((skip (current-offset em))) + (emit-i16 em 0) + (compile-expr em body scope tail?) + (emit-op em 32) + (let + ((end-jump (current-offset em))) + (emit-i16 em 0) + (patch-i16 em skip (- (current-offset em) (+ skip 2))) + (compile-cond em rest-clauses scope tail?) + (patch-i16 + em + end-jump + (- (current-offset em) (+ end-jump 2))))))))))) + (define + compile-case + (fn + (em args scope tail?) + "Compile (case expr val1 body1 val2 body2 ... :else fallback)." + (compile-expr em (first args) scope false) + (let + ((clauses (rest args))) + (compile-case-clauses em clauses scope tail?)))) + (define + compile-case-clauses + (fn + (em clauses scope tail?) + (if + (< (len clauses) 2) + (do (emit-op em 5) (emit-op em 2)) + (let + ((test (first clauses)) + (body (nth clauses 1)) + (rest-clauses + (if (> (len clauses) 2) (slice clauses 2) (list)))) + (if + (or + (and + (= (type-of test) "keyword") + (= (keyword-name test) "else")) + (= test true)) + (do (emit-op em 5) (compile-expr em body scope tail?)) + (do + (emit-op em 6) + (compile-expr em test scope false) + (let + ((name-idx (pool-add (get em "pool") "="))) + (emit-op em 52) + (emit-u16 em name-idx) + (emit-byte em 2)) + (emit-op em 33) + (let + ((skip (current-offset em))) + (emit-i16 em 0) + (emit-op em 5) + (compile-expr em body scope tail?) + (emit-op em 32) + (let + ((end-jump (current-offset em))) + (emit-i16 em 0) + (patch-i16 em skip (- (current-offset em) (+ skip 2))) + (compile-case-clauses em rest-clauses scope tail?) + (patch-i16 + em + end-jump + (- (current-offset em) (+ end-jump 2))))))))))) + (define + compile-match + (fn + (em args scope tail?) + (compile-expr em (first args) scope false) + (letrec + ((do-clauses (fn (clauses) (if (empty? clauses) (do (emit-op em 5) (let ((idx (pool-add (get em "pool") "match: no clause matched"))) (emit-op em 1) (emit-u16 em idx) (emit-op em 52) (emit-u16 em (pool-add (get em "pool") "error")) (emit-byte em 1))) (let ((clause (first clauses)) (pattern (first clause)) (body (nth clause 1)) (rest-clauses (rest clauses))) (cond (and (= (type-of pattern) "symbol") (= (symbol-name pattern) "_")) (do (emit-op em 5) (compile-expr em body scope tail?)) (and (= (type-of pattern) "symbol") (not (= (symbol-name pattern) "true")) (not (= (symbol-name pattern) "false")) (not (= (symbol-name pattern) "nil"))) (let ((var-name (symbol-name pattern)) (inner-scope (scope-add scope var-name))) (emit-op em 13) (emit-byte em (scope-index inner-scope var-name)) (compile-expr em body inner-scope tail?)) (and (list? pattern) (= (len pattern) 2) (= (type-of (first pattern)) "symbol") (= (symbol-name (first pattern)) "quote") (= (type-of (nth pattern 1)) "symbol")) (do (emit-op em 6) (let ((idx (pool-add (get em "pool") (make-symbol (symbol-name (nth pattern 1)))))) (emit-op em 1) (emit-u16 em idx)) (let ((eq-idx (pool-add (get em "pool") "="))) (emit-op em 52) (emit-u16 em eq-idx) (emit-byte em 2)) (emit-op em 33) (let ((skip (current-offset em))) (emit-i16 em 0) (emit-op em 5) (compile-expr em body scope tail?) (emit-op em 32) (let ((end-jump (current-offset em))) (emit-i16 em 0) (patch-i16 em skip (- (current-offset em) (+ skip 2))) (do-clauses rest-clauses) (patch-i16 em end-jump (- (current-offset em) (+ end-jump 2)))))) :else (do (emit-op em 6) (compile-expr em pattern scope false) (let ((eq-idx (pool-add (get em "pool") "="))) (emit-op em 52) (emit-u16 em eq-idx) (emit-byte em 2)) (emit-op em 33) (let ((skip (current-offset em))) (emit-i16 em 0) (emit-op em 5) (compile-expr em body scope tail?) (emit-op em 32) (let ((end-jump (current-offset em))) (emit-i16 em 0) (patch-i16 em skip (- (current-offset em) (+ skip 2))) (do-clauses rest-clauses) (patch-i16 em end-jump (- (current-offset em) (+ end-jump 2)))))))))))) + (do-clauses (rest args))))) + (define + compile-thread + (fn + (em args scope tail?) + "Compile (-> val (f1 a) (f2 b)) by desugaring to nested calls." + (if + (empty? args) + (emit-op em 2) + (if + (= (len args) 1) + (compile-expr em (first args) scope tail?) + (let + ((val-expr (first args)) (forms (rest args))) + (compile-thread-step em val-expr forms scope tail?)))))) + (define + compile-thread-step + (fn + (em val-expr forms scope tail?) + (if + (empty? forms) + (compile-expr em val-expr scope tail?) + (let + ((form (first forms)) + (rest-forms (rest forms)) + (is-tail (and tail? (empty? rest-forms)))) + (let + ((call-expr (if (list? form) (concat (list (first form) val-expr) (rest form)) (list form val-expr)))) + (if + (empty? rest-forms) + (compile-expr em call-expr scope is-tail) + (do + (compile-expr em call-expr scope false) + (compile-thread-step em call-expr rest-forms scope tail?)))))))) + (define + compile-defcomp + (fn + (em args scope) + "Compile defcomp/defisland — delegates to runtime via GLOBAL_GET + CALL." + (let + ((name-idx (pool-add (get em "pool") "eval-defcomp"))) + (emit-op em 20) + (emit-u16 em name-idx)) + (emit-const em (concat (list (make-symbol "defcomp")) args)) + (emit-op em 48) + (emit-byte em 1))) + (define + compile-defmacro + (fn + (em args scope) + "Compile defmacro — delegates to runtime via GLOBAL_GET + CALL." + (let + ((name-idx (pool-add (get em "pool") "eval-defmacro"))) + (emit-op em 20) + (emit-u16 em name-idx)) + (emit-const em (concat (list (make-symbol "defmacro")) args)) + (emit-op em 48) + (emit-byte em 1))) + (define + compile-quasiquote + (fn + (em expr scope) + "Compile quasiquote inline — walks the template at compile time,\n emitting code that builds the structure at runtime. Unquoted\n expressions are compiled normally (resolving locals/upvalues),\n avoiding the qq-expand-runtime env-lookup limitation." + (compile-qq-expr em expr scope))) + (define + compile-qq-expr + (fn + (em expr scope) + "Compile a quasiquote sub-expression." + (if + (not (= (type-of expr) "list")) + (emit-const em expr) + (if + (empty? expr) + (do (emit-op em 64) (emit-u16 em 0)) + (let + ((head (first expr))) (if (and - (= (type-of item) "list") - (>= (len item) 2) - (= (type-of (first item)) "symbol") - (= (symbol-name (first item)) "splice-unquote")) - (do - (when - (> pending 0) - (emit-op em 64) - (emit-u16 em pending) - (set! segment-count (+ segment-count 1)) - (set! pending 0)) - (compile-expr em (nth item 1) scope false) - (set! segment-count (+ segment-count 1))) - (do - (compile-qq-expr em item scope) - (set! pending (+ pending 1))))) - items) - (when - (> pending 0) - (emit-op em 64) - (emit-u16 em pending) - (set! segment-count (+ segment-count 1))) - (when - (> segment-count 1) - (let - ((concat-idx (pool-add (get em "pool") "concat"))) - (emit-op em 52) - (emit-u16 em concat-idx) - (emit-byte em segment-count)))))))) - -;; -------------------------------------------------------------------------- -;; Function call compilation -;; -------------------------------------------------------------------------- -(define - compile-call - (fn - (em head args scope tail?) - (let - ((is-prim (and (= (type-of head) "symbol") (let ((name (symbol-name head))) (and (not (= (get (scope-resolve scope name) "type") "local")) (not (= (get (scope-resolve scope name) "type") "upvalue")) (primitive? name)))))) - (if - is-prim + (= (type-of head) "symbol") + (= (symbol-name head) "unquote")) + (compile-expr em (nth expr 1) scope false) + (compile-qq-list em expr scope))))))) + (define + compile-qq-list + (fn + (em items scope) + "Compile a quasiquote list. Handles splice-unquote by building\n segments and concatenating them." (let - ((name (symbol-name head)) - (argc (len args)) - (name-idx (pool-add (get em "pool") name))) - (for-each (fn (a) (compile-expr em a scope false)) args) - (emit-op em 52) - (emit-u16 em name-idx) - (emit-byte em argc)) - (do - (compile-expr em head scope false) - (for-each (fn (a) (compile-expr em a scope false)) args) + ((has-splice (some (fn (item) (and (= (type-of item) "list") (>= (len item) 2) (= (type-of (first item)) "symbol") (= (symbol-name (first item)) "splice-unquote"))) items))) (if - tail? - (do (emit-op em 49) (emit-byte em (len args))) - (do (emit-op em 48) (emit-byte em (len args))))))))) - -;; -------------------------------------------------------------------------- -;; Top-level API -;; -------------------------------------------------------------------------- -(define - compile - (fn - (expr) - "Compile a single SX expression to a bytecode module." - (let - ((em (make-emitter)) (scope (make-scope nil))) - (compile-expr em expr scope false) - (emit-op em 50) - {:constants (get (get em "pool") "entries") :bytecode (get em "bytecode")}))) - -(define - compile-module - (fn - (exprs) - "Compile a list of top-level expressions to a bytecode module." - (let - ((em (make-emitter)) (scope (make-scope nil))) - (for-each - (fn (expr) (compile-expr em expr scope false) (emit-op em 5)) - (init exprs)) - (compile-expr em (last exprs) scope false) - (emit-op em 50) - {:constants (get (get em "pool") "entries") :bytecode (get em "bytecode")}))) - - -)) ;; end define-library + (not has-splice) + (do + (for-each (fn (item) (compile-qq-expr em item scope)) items) + (emit-op em 64) + (emit-u16 em (len items))) + (let + ((segment-count 0) (pending 0)) + (for-each + (fn + (item) + (if + (and + (= (type-of item) "list") + (>= (len item) 2) + (= (type-of (first item)) "symbol") + (= (symbol-name (first item)) "splice-unquote")) + (do + (when + (> pending 0) + (emit-op em 64) + (emit-u16 em pending) + (set! segment-count (+ segment-count 1)) + (set! pending 0)) + (compile-expr em (nth item 1) scope false) + (set! segment-count (+ segment-count 1))) + (do + (compile-qq-expr em item scope) + (set! pending (+ pending 1))))) + items) + (when + (> pending 0) + (emit-op em 64) + (emit-u16 em pending) + (set! segment-count (+ segment-count 1))) + (when + (> segment-count 1) + (let + ((concat-idx (pool-add (get em "pool") "concat"))) + (emit-op em 52) + (emit-u16 em concat-idx) + (emit-byte em segment-count)))))))) + (define + compile-call + (fn + (em head args scope tail?) + (let + ((is-prim (and (= (type-of head) "symbol") (let ((name (symbol-name head))) (and (not (= (get (scope-resolve scope name) "type") "local")) (not (= (get (scope-resolve scope name) "type") "upvalue")) (primitive? name)))))) + (if + is-prim + (let + ((name (symbol-name head)) + (argc (len args)) + (name-idx (pool-add (get em "pool") name))) + (for-each (fn (a) (compile-expr em a scope false)) args) + (emit-op em 52) + (emit-u16 em name-idx) + (emit-byte em argc)) + (do + (compile-expr em head scope false) + (for-each (fn (a) (compile-expr em a scope false)) args) + (if + tail? + (do (emit-op em 49) (emit-byte em (len args))) + (do (emit-op em 48) (emit-byte em (len args))))))))) + (define + compile + (fn + (expr) + "Compile a single SX expression to a bytecode module." + (let + ((em (make-emitter)) (scope (make-scope nil))) + (compile-expr em expr scope false) + (emit-op em 50) + {:constants (get (get em "pool") "entries") :bytecode (get em "bytecode")}))) + (define + compile-module + (fn + (exprs) + "Compile a list of top-level expressions to a bytecode module." + (let + ((em (make-emitter)) (scope (make-scope nil))) + (for-each + (fn (expr) (compile-expr em expr scope false) (emit-op em 5)) + (init exprs)) + (compile-expr em (last exprs) scope false) + (emit-op em 50) + {:constants (get (get em "pool") "entries") :bytecode (get em "bytecode")}))))) ;; end define-library ;; Re-export to global namespace for backward compatibility (import (sx compiler)) diff --git a/lib/vm.sx b/lib/vm.sx index 8b62cc4f..6e0224a6 100644 --- a/lib/vm.sx +++ b/lib/vm.sx @@ -62,7 +62,8 @@ vm-run vm-step vm-call-closure - vm-execute-module) + vm-execute-module + vm-resume-module) (begin (define make-upvalue-cell (fn (value) {:uv-value value})) (define uv-get (fn (cell) (get cell "uv-value"))) @@ -443,7 +444,11 @@ (if (>= (frame-ip frame) (len bc)) (vm-set-frames! vm (list)) - (do (vm-step vm frame rest-frames bc consts) (loop)))))))) + (do + (vm-step vm frame rest-frames bc consts) + (when + (nil? (get (vm-globals-ref vm) "__io_request")) + (loop))))))))) (loop))) (define vm-step @@ -595,8 +600,7 @@ (= op 112) (let ((request (vm-pop vm))) - (error - (str "VM: IO suspension (OP_PERFORM) — request: " request))) + (dict-set! (vm-globals-ref vm) "__io_request" request)) :else (error (str "VM: unknown opcode " op)))))) (define vm-call-closure @@ -614,14 +618,29 @@ (fn (code globals) (let - ((closure (make-vm-closure code (list) "module" globals nil)) - (vm (make-vm globals))) + ((vm-code (code-from-value code)) (vm (make-vm globals))) (let - ((frame (make-vm-frame closure 0))) - (pad-n-nils vm (code-locals code)) + ((closure (make-vm-closure vm-code (list) "module" globals nil)) + (frame (make-vm-frame closure 0))) + (pad-n-nils vm (code-locals vm-code)) (vm-set-frames! vm (list frame)) (vm-run vm) - (vm-pop vm))))))) ;; end define-library + (let + ((io-req (get (vm-globals-ref vm) "__io_request"))) + (if (nil? io-req) (vm-pop vm) {:vm vm :suspended true :op "import" :request io-req})))))) + (define + vm-resume-module + (fn + (suspended-result) + "Resume a suspended VM after IO (import) has been resolved.\n Clears __io_request in globals, pushes nil (import result), re-runs." + (let + ((vm (get suspended-result :vm))) + (dict-set! (vm-globals-ref vm) "__io_request" nil) + (vm-push vm nil) + (vm-run vm) + (let + ((io-req (get (vm-globals-ref vm) "__io_request"))) + (if (nil? io-req) (vm-pop vm) {:vm vm :suspended true :op "import" :request io-req}))))))) ;; end define-library ;; Re-export to global namespace for backward compatibility (import (sx vm)) diff --git a/shared/static/wasm/sx-platform.js b/shared/static/wasm/sx-platform.js index cb7b74a9..20fd6975 100644 --- a/shared/static/wasm/sx-platform.js +++ b/shared/static/wasm/sx-platform.js @@ -463,13 +463,16 @@ loadLibrary(info.deps[i], loading); } + // Mark as loaded BEFORE executing — self-imports (define-library re-exports) + // will see it as already loaded and skip rather than infinite-looping. + _loadedLibs[name] = true; + // Load this module var ok = loadBytecodeFile("sx/" + info.file); if (!ok) { var sxFile = info.file.replace(/\.sxbc$/, '.sx'); ok = loadSxFile("sx/" + sxFile); } - _loadedLibs[name] = true; return !!ok; } diff --git a/shared/static/wasm/sx/adapter-dom.sxbc b/shared/static/wasm/sx/adapter-dom.sxbc index eac7ae9b..b3eb07c0 100644 --- a/shared/static/wasm/sx/adapter-dom.sxbc +++ b/shared/static/wasm/sx/adapter-dom.sxbc @@ -1,3 +1,3 @@ (sxbc 1 "f0dccdc6c6028305" (code - :constants ("SVG_NS" "http://www.w3.org/2000/svg" "MATH_NS" "http://www.w3.org/1998/Math/MathML" "island-scope?" {:upvalue-count 0 :arity 0 :constants ("not" "nil?" "scope-peek" "sx-island-scope") :bytecode (1 3 0 52 2 0 1 52 1 0 1 52 0 0 1 50)} "*memo-cache*" "dict" "*cyst-counter*" 0 "next-cyst-id" {:upvalue-count 0 :arity 0 :constants ("+" "*cyst-counter*" 1 "str" "sx-cyst-") :bytecode (20 1 0 1 2 0 52 0 0 2 21 1 0 5 1 4 0 20 1 0 52 3 0 2 50)} "contains-deref?" {:upvalue-count 0 :arity 1 :constants ("not" "list?" "empty?" "=" "type-of" "first" "symbol" "symbol-name" "deref" "some" "contains-deref?") :bytecode (16 0 52 1 0 1 52 0 0 1 33 4 0 4 32 68 0 16 0 52 2 0 1 33 4 0 4 32 55 0 16 0 52 5 0 1 52 4 0 1 1 6 0 52 3 0 2 6 33 18 0 5 16 0 52 5 0 1 52 7 0 1 1 8 0 52 3 0 2 33 4 0 3 32 9 0 20 10 0 16 0 52 9 0 2 50)} "dom-on" {:upvalue-count 0 :arity 3 :constants ("dom-listen" "lambda?" "=" 0 "len" "lambda-params" {:upvalue-count 1 :arity 1 :constants ("trampoline" "call-lambda" "list" "run-post-render-hooks") :bytecode (18 0 52 2 0 0 52 1 0 2 52 0 0 1 5 20 3 0 49 0 50)} {:upvalue-count 1 :arity 1 :constants ("trampoline" "call-lambda" "list" "run-post-render-hooks") :bytecode (18 0 16 0 52 2 0 1 52 1 0 2 52 0 0 1 5 20 3 0 49 0 50)}) :bytecode (20 0 0 16 0 16 1 16 2 52 1 0 1 33 36 0 1 3 0 16 2 52 5 0 1 52 4 0 1 52 2 0 2 33 8 0 51 6 0 1 2 32 5 0 51 7 0 1 2 32 2 0 16 2 49 3 50)} "render-to-dom" {:upvalue-count 0 :arity 3 :constants ("set-render-active!" "type-of" "nil" "=" "create-fragment" "boolean" "raw-html" "dom-parse-html" "raw-html-content" "string" "create-text-node" "number" "str" "symbol" "render-to-dom" "trampoline" "eval-expr" "keyword" "keyword-name" "dom-node" "spread" "not" "island-scope?" "scope-emit!" "element-attrs" "spread-attrs" "dict" "has-key?" "__host_handle" "list" "empty?" "render-dom-list" "signal?" "reactive-text" "deref") :bytecode (3 52 0 0 1 5 16 0 52 1 0 1 6 1 2 0 52 3 0 2 33 9 0 5 20 4 0 49 0 32 103 1 6 1 5 0 52 3 0 2 33 9 0 5 20 4 0 49 0 32 83 1 6 1 6 0 52 3 0 2 33 15 0 5 20 7 0 16 0 52 8 0 1 49 1 32 57 1 6 1 9 0 52 3 0 2 33 11 0 5 20 10 0 16 0 49 1 32 35 1 6 1 11 0 52 3 0 2 33 15 0 5 20 10 0 16 0 52 12 0 1 49 1 32 9 1 6 1 13 0 52 3 0 2 33 25 0 5 20 14 0 16 0 16 1 52 16 0 2 52 15 0 1 16 1 16 2 49 3 32 229 0 6 1 17 0 52 3 0 2 33 15 0 5 20 10 0 16 0 52 18 0 1 49 1 32 203 0 6 1 19 0 52 3 0 2 33 6 0 5 16 0 32 186 0 6 1 20 0 52 3 0 2 33 36 0 5 20 22 0 48 0 52 21 0 1 33 16 0 1 24 0 16 0 52 25 0 1 52 23 0 2 32 1 0 2 5 16 0 32 139 0 6 1 26 0 52 3 0 2 33 26 0 5 16 0 1 28 0 52 27 0 2 33 5 0 16 0 32 5 0 20 4 0 49 0 32 102 0 6 1 29 0 52 3 0 2 33 32 0 5 16 0 52 30 0 1 33 8 0 20 4 0 49 0 32 11 0 20 31 0 16 0 16 1 16 2 49 3 32 59 0 5 20 32 0 16 0 48 1 33 37 0 20 22 0 48 0 33 10 0 20 33 0 16 0 49 1 32 16 0 20 10 0 20 34 0 16 0 48 1 52 12 0 1 49 1 32 11 0 20 10 0 16 0 52 12 0 1 49 1 50)} "render-dom-list" {:upvalue-count 0 :arity 3 :constants ("first" "=" "type-of" "symbol" "symbol-name" "rest" "raw!" "render-dom-raw" "<>" "render-dom-fragment" "lake" "render-dom-lake" "marsh" "render-dom-marsh" "starts-with?" "html:" "render-dom-element" "slice" 5 "render-dom-form?" "contains?" "HTML_TAGS" ">" "len" 0 "keyword" "dispatch-render-form" "env-has?" "macro?" "env-get" "render-to-dom" "expand-macro" "~" "island?" "scope-peek" "sx-render-markers" "dom-create-element" "span" "dict" "reduce" {:upvalue-count 3 :arity 2 :constants ("get" "skip" "assoc" "i" "inc" "=" "type-of" "keyword" "<" "len" "keyword-name" "trampoline" "eval-expr" "nth" "dict-set!") :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 2 33 29 0 16 0 1 1 0 4 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 145 0 16 1 52 6 0 1 1 7 0 52 5 0 2 6 33 24 0 5 16 0 1 3 0 52 0 0 2 52 4 0 1 18 0 52 9 0 1 52 8 0 2 33 79 0 16 1 52 10 0 1 17 3 18 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 13 0 2 18 1 52 12 0 2 52 11 0 1 17 4 18 2 16 3 16 4 52 14 0 3 5 16 0 1 1 0 3 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 22 0 16 0 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 3 50)} "i" "skip" "dom-set-attr" "data-sx-island" "component-name" "not" "empty-dict?" "data-sx-state" "sx-serialize" "render-dom-island" "component?" "render-dom-component" "render-dom-unknown-component" "index-of" "-" "deref" "island-scope?" "trampoline" "eval-expr" "signal?" "reactive-text" "create-text-node" "str" "contains-deref?" "computed" {:upvalue-count 2 :arity 0 :constants ("trampoline" "eval-expr") :bytecode (18 0 18 1 52 1 0 2 52 0 0 1 50)} "lambda?" "list" "create-fragment" "for-each" {:upvalue-count 3 :arity 1 :constants ("render-to-dom" "not" "spread?" "dom-append") :bytecode (20 0 0 16 0 18 0 18 1 48 3 17 1 16 1 52 2 0 1 52 1 0 1 33 12 0 20 3 0 18 2 16 1 49 2 32 1 0 2 50)}) :bytecode (16 0 52 0 0 1 17 3 16 3 52 2 0 1 1 3 0 52 1 0 2 33 53 3 16 3 52 4 0 1 17 4 16 0 52 5 0 1 17 5 16 4 1 6 0 52 1 0 2 33 12 0 20 7 0 16 5 16 1 49 2 32 10 3 16 4 1 8 0 52 1 0 2 33 14 0 20 9 0 16 5 16 1 16 2 49 3 32 240 2 16 4 1 10 0 52 1 0 2 33 14 0 20 11 0 16 5 16 1 16 2 49 3 32 214 2 16 4 1 12 0 52 1 0 2 33 14 0 20 13 0 16 5 16 1 16 2 49 3 32 188 2 16 4 1 15 0 52 14 0 2 33 23 0 20 16 0 16 4 1 18 0 52 17 0 2 16 5 16 1 16 2 49 4 32 153 2 20 19 0 16 4 48 1 33 91 0 20 21 0 16 4 52 20 0 2 6 33 43 0 5 16 5 52 23 0 1 1 24 0 52 22 0 2 6 33 18 0 5 16 5 52 0 0 1 52 2 0 1 1 25 0 52 1 0 2 6 34 3 0 5 16 2 33 16 0 20 16 0 16 4 16 5 16 1 16 2 49 4 32 13 0 20 26 0 16 4 16 0 16 1 16 2 49 4 32 52 2 16 1 16 4 52 27 0 2 6 33 13 0 5 16 1 16 4 52 29 0 2 52 28 0 1 33 28 0 20 30 0 16 1 16 4 52 29 0 2 16 5 16 1 52 31 0 3 16 1 16 2 49 3 32 252 1 20 21 0 16 4 52 20 0 2 33 16 0 20 16 0 16 4 16 5 16 1 16 2 49 4 32 224 1 16 4 1 32 0 52 14 0 2 6 33 26 0 5 16 1 16 4 52 27 0 2 6 33 13 0 5 16 1 16 4 52 29 0 2 52 33 0 1 33 145 0 1 35 0 52 34 0 1 33 113 0 16 1 16 4 52 29 0 2 17 6 20 36 0 1 37 0 2 48 2 17 7 52 38 0 0 17 8 51 40 0 1 5 1 1 1 8 1 41 0 1 24 0 1 42 0 4 52 38 0 4 16 5 52 39 0 3 5 20 43 0 16 7 1 44 0 16 6 52 45 0 1 48 3 5 16 8 52 47 0 1 52 46 0 1 33 19 0 20 43 0 16 7 1 48 0 16 8 52 49 0 1 48 3 32 1 0 2 5 16 7 32 19 0 20 50 0 16 1 16 4 52 29 0 2 16 5 16 1 16 2 49 4 32 37 1 16 4 1 32 0 52 14 0 2 33 45 0 16 1 16 4 52 29 0 2 17 6 16 6 52 51 0 1 33 16 0 20 52 0 16 6 16 5 16 1 16 2 49 4 32 7 0 20 53 0 16 4 49 1 32 236 0 16 4 1 55 0 52 54 0 2 1 24 0 52 22 0 2 6 33 36 0 5 16 5 52 23 0 1 1 24 0 52 22 0 2 6 33 18 0 5 16 5 52 0 0 1 52 2 0 1 1 25 0 52 1 0 2 33 16 0 20 16 0 16 4 16 5 16 1 16 2 49 4 32 161 0 16 2 33 16 0 20 16 0 16 4 16 5 16 1 16 2 49 4 32 140 0 16 4 1 56 0 52 1 0 2 6 33 6 0 5 20 57 0 48 0 33 57 0 16 5 52 0 0 1 16 1 52 59 0 2 52 58 0 1 17 6 20 60 0 16 6 48 1 33 10 0 20 61 0 16 6 49 1 32 16 0 20 62 0 20 56 0 16 6 48 1 52 63 0 1 49 1 32 61 0 20 57 0 48 0 6 33 8 0 5 20 64 0 16 0 48 1 33 20 0 20 61 0 20 65 0 51 66 0 1 0 1 1 48 1 49 1 32 21 0 20 30 0 16 0 16 1 52 59 0 2 52 58 0 1 16 1 16 2 49 3 32 76 0 16 3 52 67 0 1 6 34 14 0 5 16 3 52 2 0 1 1 68 0 52 1 0 2 33 24 0 20 30 0 16 0 16 1 52 59 0 2 52 58 0 1 16 1 16 2 49 3 32 25 0 20 69 0 48 0 17 4 51 71 0 1 1 1 2 1 4 16 0 52 70 0 2 5 16 4 50)} "render-dom-element" {:upvalue-count 0 :arity 4 :constants ("=" "svg" "SVG_NS" "math" "MATH_NS" "dom-create-element" "scope-push!" "element-attrs" "reduce" {:upvalue-count 5 :arity 2 :constants ("get" "skip" "assoc" "i" "inc" "=" "type-of" "keyword" "<" "len" "keyword-name" "nth" "starts-with?" "on-" "trampoline" "eval-expr" "callable?" "dom-on" "slice" 3 "bind" "signal?" "bind-input" "ref" "dict-set!" "current" "key" "dom-set-attr" "str" "island-scope?" "reactive-attr" {:upvalue-count 2 :arity 0 :constants ("trampoline" "eval-expr") :bytecode (18 0 18 1 52 1 0 2 52 0 0 1 50)} "nil?" "contains?" "BOOLEAN_ATTRS" "" "not" "VOID_ELEMENTS" "render-to-dom" "spread?" "reactive-spread" {:upvalue-count 3 :arity 0 :constants ("render-to-dom") :bytecode (20 0 0 18 0 18 1 18 2 49 3 50)} "dom-append") :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 2 33 29 0 16 0 1 1 0 4 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 47 2 16 1 52 6 0 1 1 7 0 52 5 0 2 6 33 24 0 5 16 0 1 3 0 52 0 0 2 52 4 0 1 18 0 52 9 0 1 52 8 0 2 33 143 1 16 1 52 10 0 1 17 3 18 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 11 0 2 17 4 16 3 1 13 0 52 12 0 2 33 49 0 16 4 18 1 52 15 0 2 52 14 0 1 17 5 20 16 0 16 5 48 1 33 21 0 20 17 0 18 2 16 3 1 19 0 52 18 0 2 16 5 48 3 32 1 0 2 32 23 1 16 3 1 20 0 52 5 0 2 33 40 0 16 4 18 1 52 15 0 2 52 14 0 1 17 5 20 21 0 16 5 48 1 33 12 0 20 22 0 18 2 16 5 48 2 32 1 0 2 32 227 0 16 3 1 23 0 52 5 0 2 33 28 0 16 4 18 1 52 15 0 2 52 14 0 1 17 5 16 5 1 25 0 18 2 52 24 0 3 32 187 0 16 3 1 26 0 52 5 0 2 33 33 0 16 4 18 1 52 15 0 2 52 14 0 1 17 5 20 27 0 18 2 1 26 0 16 5 52 28 0 1 48 3 32 142 0 20 29 0 48 0 33 19 0 20 30 0 18 2 16 3 51 31 0 1 4 0 1 48 3 32 115 0 16 4 18 1 52 15 0 2 52 14 0 1 17 5 16 5 52 32 0 1 6 34 8 0 5 16 5 4 52 5 0 2 33 4 0 2 32 76 0 20 34 0 16 3 52 33 0 2 33 24 0 16 5 33 15 0 20 27 0 18 2 16 3 1 35 0 48 3 32 1 0 2 32 40 0 16 5 3 52 5 0 2 33 15 0 20 27 0 18 2 16 3 1 35 0 48 3 32 15 0 20 27 0 18 2 16 3 16 5 52 28 0 1 48 3 5 16 0 1 1 0 3 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 116 0 20 37 0 18 3 52 33 0 2 52 36 0 1 33 76 0 20 38 0 16 1 18 1 18 4 48 3 17 3 16 3 52 39 0 1 6 33 6 0 5 20 29 0 48 0 33 19 0 20 40 0 18 2 51 41 0 1 1 0 1 0 4 48 2 32 22 0 16 3 52 39 0 1 33 4 0 2 32 9 0 20 42 0 18 2 16 3 48 2 32 1 0 2 5 16 0 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 3 50)} "dict" "i" 0 "skip" "for-each" {:upvalue-count 1 :arity 1 :constants ("for-each" {:upvalue-count 2 :arity 1 :constants ("dict-get" "=" "class" "dom-get-attr" "dom-set-attr" "not" "" "str" " " "style" ";") :bytecode (18 0 16 0 52 0 0 2 17 1 16 0 1 2 0 52 1 0 2 33 64 0 20 3 0 18 1 1 2 0 48 2 17 2 20 4 0 18 1 1 2 0 16 2 6 33 14 0 5 16 2 1 6 0 52 1 0 2 52 5 0 1 33 14 0 16 2 1 8 0 16 1 52 7 0 3 32 2 0 16 1 49 3 32 91 0 16 0 1 9 0 52 1 0 2 33 64 0 20 3 0 18 1 1 9 0 48 2 17 2 20 4 0 18 1 1 9 0 16 2 6 33 14 0 5 16 2 1 6 0 52 1 0 2 52 5 0 1 33 14 0 16 2 1 10 0 16 1 52 7 0 3 32 2 0 16 1 49 3 32 15 0 20 4 0 18 1 16 0 16 1 52 7 0 1 49 3 50)} "keys") :bytecode (51 1 0 1 0 0 0 16 0 52 2 0 1 52 0 0 2 50)} "scope-emitted" "scope-pop!") :bytecode (16 0 1 1 0 52 0 0 2 33 6 0 20 2 0 32 20 0 16 0 1 3 0 52 0 0 2 33 6 0 20 4 0 32 2 0 16 3 17 4 20 5 0 16 0 16 4 48 2 17 5 1 7 0 2 52 6 0 2 5 51 9 0 1 1 1 2 1 5 1 0 1 4 1 11 0 1 12 0 1 13 0 4 52 10 0 4 16 1 52 8 0 3 5 51 15 0 1 5 1 7 0 52 16 0 1 52 14 0 2 5 1 7 0 52 17 0 1 5 16 5 50)} "render-dom-component" {:upvalue-count 0 :arity 4 :constants ("dict" "list" "reduce" {:upvalue-count 4 :arity 2 :constants ("get" "skip" "assoc" "i" "inc" "=" "type-of" "keyword" "<" "len" "trampoline" "eval-expr" "nth" "dict-set!" "keyword-name" "append!") :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 2 33 29 0 16 0 1 1 0 4 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 150 0 16 1 52 6 0 1 1 7 0 52 5 0 2 6 33 24 0 5 16 0 1 3 0 52 0 0 2 52 4 0 1 18 0 52 9 0 1 52 8 0 2 33 75 0 18 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 12 0 2 18 1 52 11 0 2 52 10 0 1 17 3 18 2 16 1 52 14 0 1 16 3 52 13 0 3 5 16 0 1 1 0 3 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 31 0 18 3 16 1 52 15 0 2 5 16 0 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 3 50)} "i" 0 "skip" "env-merge" "component-closure" "for-each" {:upvalue-count 2 :arity 1 :constants ("env-bind!" "dict-has?" "dict-get") :bytecode (18 0 16 0 18 1 16 0 52 1 0 2 33 11 0 18 1 16 0 52 2 0 2 32 1 0 2 52 0 0 3 50)} "component-params" "component-has-children?" "create-fragment" {:upvalue-count 3 :arity 1 :constants ("render-to-dom" "not" "spread?" "dom-append") :bytecode (20 0 0 16 0 18 0 18 1 48 3 17 1 16 1 52 2 0 1 52 1 0 1 33 12 0 20 3 0 18 2 16 1 49 2 32 1 0 2 50)} "env-bind!" "children" "render-to-dom" "component-body") :bytecode (52 0 0 0 17 4 52 1 0 0 17 5 51 3 0 1 1 1 2 1 4 1 5 1 4 0 1 5 0 1 6 0 4 52 0 0 4 16 1 52 2 0 3 5 16 0 52 8 0 1 16 2 52 7 0 2 17 6 51 10 0 1 6 1 4 16 0 52 11 0 1 52 9 0 2 5 16 0 52 12 0 1 33 37 0 20 13 0 48 0 17 7 51 14 0 1 2 1 3 1 7 16 5 52 9 0 2 5 16 6 1 16 0 16 7 52 15 0 3 32 1 0 2 5 20 17 0 16 0 52 18 0 1 16 6 16 3 49 3 50)} "render-dom-fragment" {:upvalue-count 0 :arity 3 :constants ("create-fragment" "for-each" {:upvalue-count 3 :arity 1 :constants ("render-to-dom" "not" "spread?" "dom-append") :bytecode (20 0 0 16 0 18 0 18 1 48 3 17 1 16 1 52 2 0 1 52 1 0 1 33 12 0 20 3 0 18 2 16 1 49 2 32 1 0 2 50)}) :bytecode (20 0 0 48 0 17 3 51 2 0 1 1 1 2 1 3 16 0 52 1 0 2 5 16 3 50)} "render-dom-raw" {:upvalue-count 0 :arity 2 :constants ("create-fragment" "for-each" {:upvalue-count 2 :arity 1 :constants ("trampoline" "eval-expr" "=" "type-of" "string" "dom-append" "dom-parse-html" "dom-node" "dom-clone" "not" "nil?" "create-text-node" "str") :bytecode (16 0 18 0 52 1 0 2 52 0 0 1 17 1 16 1 52 3 0 1 1 4 0 52 2 0 2 33 17 0 20 5 0 18 1 20 6 0 16 1 48 1 49 2 32 68 0 16 1 52 3 0 1 1 7 0 52 2 0 2 33 17 0 20 5 0 18 1 20 8 0 16 1 48 1 49 2 32 35 0 16 1 52 10 0 1 52 9 0 1 33 21 0 20 5 0 18 1 20 11 0 16 1 52 12 0 1 48 1 49 2 32 1 0 2 50)}) :bytecode (20 0 0 48 0 17 2 51 2 0 1 1 1 2 16 0 52 1 0 2 5 16 2 50)} "render-dom-unknown-component" {:upvalue-count 0 :arity 1 :constants ("error" "str" "Unknown component: ") :bytecode (1 2 0 16 0 52 1 0 2 52 0 0 1 50)} "RENDER_DOM_FORMS" "list" "if" "when" "cond" "case" "let" "let*" "letrec" "begin" "do" "define" "defcomp" "defisland" "defmacro" "defstyle" "map" "map-indexed" "filter" "for-each" "portal" "error-boundary" "scope" "provide" "cyst" "render-dom-form?" {:upvalue-count 0 :arity 1 :constants ("contains?" "RENDER_DOM_FORMS") :bytecode (20 1 0 16 0 52 0 0 2 50)} "dispatch-render-form" {:upvalue-count 0 :arity 4 :constants ("=" "if" "island-scope?" "create-comment" "r-if" "list" "effect" {:upvalue-count 6 :arity 0 :constants ("trampoline" "eval-expr" "nth" 1 "render-to-dom" 2 ">" "len" 3 "create-fragment" "dom-parent" "for-each" {:upvalue-count 0 :arity 1 :constants ("dom-remove") :bytecode (20 0 0 16 0 49 1 50)} "dom-is-fragment?" "dom-child-nodes" "list" "dom-insert-after") :bytecode (18 0 1 3 0 52 2 0 2 18 1 52 1 0 2 52 0 0 1 17 1 16 1 33 21 0 20 4 0 18 0 1 5 0 52 2 0 2 18 1 18 2 48 3 32 42 0 18 0 52 7 0 1 1 8 0 52 6 0 2 33 21 0 20 4 0 18 0 1 8 0 52 2 0 2 18 1 18 2 48 3 32 5 0 20 9 0 48 0 17 0 20 10 0 18 3 48 1 33 51 0 51 12 0 18 4 52 11 0 2 5 20 13 0 16 0 48 1 33 10 0 20 14 0 16 0 48 1 32 6 0 16 0 52 15 0 1 19 4 5 20 16 0 18 3 16 0 49 2 32 4 0 16 0 19 5 50)} "spread?" "create-fragment" "dom-append" "dom-is-fragment?" "dom-child-nodes" "trampoline" "eval-expr" "nth" 1 "render-to-dom" 2 ">" "len" 3 "when" "r-when" {:upvalue-count 6 :arity 0 :constants ("dom-parent" "for-each" {:upvalue-count 0 :arity 1 :constants ("dom-remove") :bytecode (20 0 0 16 0 49 1 50)} "list" "trampoline" "eval-expr" "nth" 1 "create-fragment" {:upvalue-count 4 :arity 1 :constants ("dom-append" "render-to-dom" "nth") :bytecode (20 0 0 18 0 20 1 0 18 1 16 0 52 2 0 2 18 2 18 3 48 3 49 2 50)} "range" 2 "len" "dom-child-nodes" "dom-insert-after") :bytecode (20 0 0 18 0 48 1 33 101 0 51 2 0 18 1 52 1 0 2 5 52 3 0 0 19 1 5 18 2 1 7 0 52 6 0 2 18 3 52 5 0 2 52 4 0 1 33 58 0 20 8 0 48 0 17 0 51 9 0 1 0 0 2 0 3 0 4 1 11 0 18 2 52 12 0 1 52 10 0 2 52 1 0 2 5 20 13 0 16 0 48 1 19 1 5 20 14 0 18 0 16 0 49 2 32 1 0 2 32 76 0 18 2 1 7 0 52 6 0 2 18 3 52 5 0 2 52 4 0 1 33 53 0 20 8 0 48 0 17 0 51 9 0 1 0 0 2 0 3 0 4 1 11 0 18 2 52 12 0 1 52 10 0 2 52 1 0 2 5 20 13 0 16 0 48 1 19 1 5 16 0 19 5 32 1 0 2 50)} "not" "for-each" {:upvalue-count 4 :arity 1 :constants ("dom-append" "render-to-dom" "nth") :bytecode (20 0 0 18 0 20 1 0 18 1 16 0 52 2 0 2 18 2 18 3 48 3 49 2 50)} "range" "cond" "r-cond" {:upvalue-count 6 :arity 0 :constants ("eval-cond" "rest" "dom-parent" "for-each" {:upvalue-count 0 :arity 1 :constants ("dom-remove") :bytecode (20 0 0 16 0 49 1 50)} "list" "render-to-dom" "dom-is-fragment?" "dom-child-nodes" "dom-insert-after") :bytecode (20 0 0 18 0 52 1 0 1 18 1 48 2 17 0 20 2 0 18 2 48 1 33 80 0 51 4 0 18 3 52 3 0 2 5 52 5 0 0 19 3 5 16 0 33 54 0 20 6 0 16 0 18 1 18 4 48 3 17 1 20 7 0 16 1 48 1 33 10 0 20 8 0 16 1 48 1 32 6 0 16 1 52 5 0 1 19 3 5 20 9 0 18 2 16 1 49 2 32 1 0 2 32 55 0 16 0 33 49 0 20 6 0 16 0 18 1 18 4 48 3 17 1 20 7 0 16 1 48 1 33 10 0 20 8 0 16 1 48 1 32 6 0 16 1 52 5 0 1 19 3 5 16 1 19 5 32 1 0 2 50)} "eval-cond" "rest" "case" "let" "let*" "process-bindings" {:upvalue-count 4 :arity 1 :constants ("render-to-dom" "nth" "not" "spread?" "dom-append") :bytecode (20 0 0 18 0 16 0 52 1 0 2 18 1 18 2 48 3 17 1 16 1 52 3 0 1 52 2 0 1 33 12 0 20 4 0 18 3 16 1 49 2 32 1 0 2 50)} "letrec" "slice" "env-extend" {:upvalue-count 1 :arity 1 :constants ("=" "type-of" "first" "symbol" "symbol-name" "str" "env-bind!") :bytecode (16 0 52 2 0 1 52 1 0 1 1 3 0 52 0 0 2 33 13 0 16 0 52 2 0 1 52 4 0 1 32 10 0 16 0 52 2 0 1 52 5 0 1 17 1 18 0 16 1 2 52 6 0 3 50)} {:upvalue-count 1 :arity 1 :constants ("=" "type-of" "first" "symbol" "symbol-name" "str" "env-set!" "trampoline" "eval-expr" "nth" 1) :bytecode (16 0 52 2 0 1 52 1 0 1 1 3 0 52 0 0 2 33 13 0 16 0 52 2 0 1 52 4 0 1 32 10 0 16 0 52 2 0 1 52 5 0 1 17 1 18 0 16 1 16 0 1 10 0 52 9 0 2 18 0 52 8 0 2 52 7 0 1 52 6 0 3 50)} {:upvalue-count 1 :arity 1 :constants ("trampoline" "eval-expr") :bytecode (16 0 18 0 52 1 0 2 52 0 0 1 50)} "init" "last" "begin" "do" "definition-form?" "map" "type-of" "first" "symbol" "symbol-name" "deref" "signal?" "reactive-list" {:upvalue-count 4 :arity 1 :constants ("lambda?" "render-lambda-dom" "list" "render-to-dom" "apply" "dom-append") :bytecode (18 0 52 0 0 1 33 20 0 20 1 0 18 0 16 0 52 2 0 1 18 1 18 2 48 4 32 21 0 20 3 0 18 0 16 0 52 2 0 1 52 4 0 2 18 1 18 2 48 3 17 1 20 5 0 18 3 16 1 49 2 50)} "map-indexed" "for-each-indexed" {:upvalue-count 4 :arity 2 :constants ("lambda?" "render-lambda-dom" "list" "render-to-dom" "apply" "dom-append") :bytecode (18 0 52 0 0 1 33 22 0 20 1 0 18 0 16 0 16 1 52 2 0 2 18 1 18 2 48 4 32 23 0 20 3 0 18 0 16 0 16 1 52 2 0 2 52 4 0 2 18 1 18 2 48 3 17 2 20 5 0 18 3 16 2 49 2 50)} "filter" "portal" "render-dom-portal" "error-boundary" "render-dom-error-boundary" "scope" ">=" "keyword" "keyword-name" "value" "scope-push!" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)} "scope-pop!" "provide" "cyst" "key" "str" "next-cyst-id" "get" "*memo-cache*" "host-get" "isConnected" "dom-create-element" "div" "dom-set-attr" "data-sx-cyst" "with-island-scope" {:upvalue-count 1 :arity 1 :constants ("append!") :bytecode (18 0 16 0 52 0 0 2 50)} {:upvalue-count 3 :arity 0 :constants ("create-fragment" "for-each" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)}) :bytecode (20 0 0 48 0 17 0 51 2 0 1 0 0 0 0 1 18 2 52 1 0 2 5 16 0 50)} "dom-set-data" "sx-disposers" "dict-set!") :bytecode (16 0 1 1 0 52 0 0 2 33 224 0 20 2 0 48 0 33 124 0 20 3 0 1 4 0 48 1 17 4 52 5 0 0 17 5 2 17 6 20 6 0 51 7 0 1 1 1 2 1 3 1 4 1 5 1 6 48 1 5 16 6 52 8 0 1 33 5 0 16 6 32 67 0 20 9 0 48 0 17 7 20 10 0 16 7 16 4 48 2 5 16 6 33 41 0 20 11 0 16 6 48 1 33 10 0 20 12 0 16 6 48 1 32 6 0 16 6 52 5 0 1 17 5 5 20 10 0 16 7 16 6 48 2 32 1 0 2 5 16 7 32 89 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 4 16 4 33 21 0 20 17 0 16 1 1 18 0 52 15 0 2 16 2 16 3 49 3 32 42 0 16 1 52 20 0 1 1 21 0 52 19 0 2 33 21 0 20 17 0 16 1 1 21 0 52 15 0 2 16 2 16 3 49 3 32 5 0 20 9 0 49 0 32 176 7 16 0 1 22 0 52 0 0 2 33 178 0 20 2 0 48 0 33 95 0 20 3 0 1 23 0 48 1 17 4 52 5 0 0 17 5 2 17 6 20 6 0 51 24 0 1 4 1 5 1 1 1 2 1 3 1 6 48 1 5 16 6 52 8 0 1 33 5 0 16 6 32 38 0 20 9 0 48 0 17 7 20 10 0 16 7 16 4 48 2 5 16 6 33 12 0 20 10 0 16 7 16 6 48 2 32 1 0 2 5 16 7 32 72 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 52 25 0 1 33 8 0 20 9 0 49 0 32 38 0 20 9 0 48 0 17 4 51 27 0 1 4 1 1 1 2 1 3 1 18 0 16 1 52 20 0 1 52 28 0 2 52 26 0 2 5 16 4 32 242 6 16 0 1 29 0 52 0 0 2 33 145 0 20 2 0 48 0 33 95 0 20 3 0 1 30 0 48 1 17 4 52 5 0 0 17 5 2 17 6 20 6 0 51 31 0 1 1 1 2 1 4 1 5 1 3 1 6 48 1 5 16 6 52 8 0 1 33 5 0 16 6 32 38 0 20 9 0 48 0 17 7 20 10 0 16 7 16 4 48 2 5 16 6 33 12 0 20 10 0 16 7 16 6 48 2 32 1 0 2 5 16 7 32 39 0 20 32 0 16 1 52 33 0 1 16 2 48 2 17 4 16 4 33 14 0 20 17 0 16 4 16 2 16 3 49 3 32 5 0 20 9 0 49 0 32 85 6 16 0 1 34 0 52 0 0 2 33 24 0 20 17 0 16 1 16 2 52 14 0 2 52 13 0 1 16 2 16 3 49 3 32 49 6 16 0 1 35 0 52 0 0 2 6 34 10 0 5 16 0 1 36 0 52 0 0 2 33 96 0 20 37 0 16 1 1 16 0 52 15 0 2 16 2 48 2 17 4 16 1 52 20 0 1 1 21 0 52 0 0 2 33 21 0 20 17 0 16 1 1 18 0 52 15 0 2 16 4 16 3 49 3 32 38 0 20 9 0 48 0 17 5 51 38 0 1 1 1 4 1 3 1 5 1 18 0 16 1 52 20 0 1 52 28 0 2 52 26 0 2 5 16 5 32 183 5 16 0 1 39 0 52 0 0 2 33 108 0 16 1 1 16 0 52 15 0 2 17 4 16 1 1 18 0 52 40 0 2 17 5 16 2 52 41 0 1 17 6 51 42 0 1 6 16 4 52 26 0 2 5 51 43 0 1 6 16 4 52 26 0 2 5 16 5 52 20 0 1 1 16 0 52 19 0 2 33 18 0 51 44 0 1 6 16 5 52 45 0 1 52 26 0 2 32 1 0 2 5 20 17 0 16 5 52 46 0 1 16 6 16 3 49 3 32 63 5 16 0 1 47 0 52 0 0 2 6 34 10 0 5 16 0 1 48 0 52 0 0 2 33 78 0 16 1 52 20 0 1 1 18 0 52 0 0 2 33 21 0 20 17 0 16 1 1 16 0 52 15 0 2 16 2 16 3 49 3 32 38 0 20 9 0 48 0 17 4 51 38 0 1 1 1 2 1 3 1 4 1 16 0 16 1 52 20 0 1 52 28 0 2 52 26 0 2 5 16 4 32 215 4 20 49 0 16 0 48 1 33 21 0 16 1 16 2 52 14 0 2 52 13 0 1 5 20 9 0 49 0 32 184 4 16 0 1 50 0 52 0 0 2 33 22 1 16 1 1 18 0 52 15 0 2 17 4 20 2 0 48 0 6 33 76 0 5 16 4 52 51 0 1 1 5 0 52 0 0 2 6 33 58 0 5 16 4 52 20 0 1 1 16 0 52 19 0 2 6 33 40 0 5 16 4 52 52 0 1 52 51 0 1 1 53 0 52 0 0 2 6 33 18 0 5 16 4 52 52 0 1 52 54 0 1 1 55 0 52 0 0 2 33 107 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 5 16 4 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 6 20 56 0 16 6 48 1 33 16 0 20 57 0 16 5 16 6 16 2 16 3 49 4 32 36 0 20 55 0 16 6 48 1 17 7 20 9 0 48 0 17 8 51 58 0 1 5 1 2 1 3 1 8 16 7 52 26 0 2 5 16 8 32 69 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 5 16 1 1 18 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 6 20 9 0 48 0 17 7 51 58 0 1 5 1 2 1 3 1 7 16 6 52 26 0 2 5 16 7 32 150 3 16 0 1 59 0 52 0 0 2 33 72 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 4 16 1 1 18 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 5 20 9 0 48 0 17 6 51 61 0 1 4 1 2 1 3 1 6 16 5 52 60 0 2 5 16 6 32 66 3 16 0 1 62 0 52 0 0 2 33 24 0 20 17 0 16 1 16 2 52 14 0 2 52 13 0 1 16 2 16 3 49 3 32 30 3 16 0 1 63 0 52 0 0 2 33 18 0 20 64 0 16 1 52 33 0 1 16 2 16 3 49 3 32 0 3 16 0 1 65 0 52 0 0 2 33 18 0 20 66 0 16 1 52 33 0 1 16 2 16 3 49 3 32 226 2 16 0 1 26 0 52 0 0 2 33 72 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 4 16 1 1 18 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 5 20 9 0 48 0 17 6 51 58 0 1 4 1 2 1 3 1 6 16 5 52 26 0 2 5 16 6 32 142 2 16 0 1 67 0 52 0 0 2 33 183 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 4 16 1 1 18 0 52 40 0 2 17 5 2 17 6 2 17 7 20 9 0 48 0 17 8 16 5 52 20 0 1 1 18 0 52 68 0 2 6 33 40 0 5 16 5 52 52 0 1 52 51 0 1 1 69 0 52 0 0 2 6 33 18 0 5 16 5 52 52 0 1 52 70 0 1 1 71 0 52 0 0 2 33 36 0 16 5 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 6 5 16 5 1 18 0 52 40 0 2 17 7 32 4 0 16 5 17 7 5 16 4 16 6 52 72 0 2 5 51 73 0 1 8 1 2 1 3 16 7 52 26 0 2 5 16 4 52 74 0 1 5 16 8 32 203 1 16 0 1 75 0 52 0 0 2 33 99 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 4 16 1 1 18 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 5 20 9 0 48 0 17 6 16 4 16 5 52 72 0 2 5 51 27 0 1 6 1 1 1 2 1 3 1 21 0 16 1 52 20 0 1 52 28 0 2 52 26 0 2 5 16 4 52 74 0 1 5 16 6 32 92 1 16 0 1 76 0 52 0 0 2 33 59 1 16 1 52 20 0 1 1 18 0 52 19 0 2 6 33 46 0 5 16 1 1 16 0 52 15 0 2 52 51 0 1 1 69 0 52 0 0 2 6 33 21 0 5 16 1 1 16 0 52 15 0 2 52 70 0 1 1 77 0 52 0 0 2 33 26 0 16 1 1 18 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 52 78 0 1 32 5 0 20 79 0 48 0 17 4 20 81 0 16 4 52 80 0 2 17 5 16 5 6 33 11 0 5 20 82 0 16 5 1 83 0 48 2 33 5 0 16 5 32 177 0 20 84 0 1 85 0 2 48 2 17 6 52 5 0 0 17 7 16 1 52 20 0 1 1 18 0 52 19 0 2 6 33 46 0 5 16 1 1 16 0 52 15 0 2 52 51 0 1 1 69 0 52 0 0 2 6 33 21 0 5 16 1 1 16 0 52 15 0 2 52 70 0 1 1 77 0 52 0 0 2 33 12 0 16 1 1 21 0 52 40 0 2 32 9 0 16 1 1 16 0 52 40 0 2 17 8 20 86 0 16 6 1 87 0 16 4 48 3 5 20 88 0 51 89 0 1 7 51 90 0 1 2 1 3 1 8 48 2 17 9 20 10 0 16 6 16 9 48 2 5 20 91 0 16 6 1 92 0 16 7 48 3 5 20 81 0 16 4 16 6 52 93 0 3 5 16 6 32 21 0 20 17 0 16 1 16 2 52 14 0 2 52 13 0 1 16 2 16 3 49 3 50)} "render-lambda-dom" {:upvalue-count 0 :arity 4 :constants ("env-merge" "lambda-closure" "for-each-indexed" {:upvalue-count 2 :arity 2 :constants ("env-bind!" "nth") :bytecode (18 0 16 1 18 1 16 0 52 1 0 2 52 0 0 3 50)} "lambda-params" "render-to-dom" "lambda-body") :bytecode (16 0 52 1 0 1 16 2 52 0 0 2 17 4 51 3 0 1 4 1 1 16 0 52 4 0 1 52 2 0 2 5 20 5 0 16 0 52 6 0 1 16 4 16 3 49 3 50)} "render-dom-island" {:upvalue-count 0 :arity 4 :constants ("dict" "list" "reduce" {:upvalue-count 4 :arity 2 :constants ("get" "skip" "assoc" "i" "inc" "=" "type-of" "keyword" "<" "len" "trampoline" "eval-expr" "nth" "dict-set!" "keyword-name" "append!") :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 2 33 29 0 16 0 1 1 0 4 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 150 0 16 1 52 6 0 1 1 7 0 52 5 0 2 6 33 24 0 5 16 0 1 3 0 52 0 0 2 52 4 0 1 18 0 52 9 0 1 52 8 0 2 33 75 0 18 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 12 0 2 18 1 52 11 0 2 52 10 0 1 17 3 18 2 16 1 52 14 0 1 16 3 52 13 0 3 5 16 0 1 1 0 3 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 31 0 18 3 16 1 52 15 0 2 5 16 0 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 3 50)} "i" 0 "skip" "env-merge" "component-closure" "component-name" "for-each" {:upvalue-count 2 :arity 1 :constants ("env-bind!" "dict-has?" "dict-get") :bytecode (18 0 16 0 18 1 16 0 52 1 0 2 33 11 0 18 1 16 0 52 2 0 2 32 1 0 2 52 0 0 3 50)} "component-params" "component-has-children?" "create-fragment" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)} "env-bind!" "children" "dom-create-element" "span" "dom-set-attr" "data-sx-island" "not" "empty-dict?" "data-sx-state" "sx-serialize" "mark-processed!" "island-hydrated" "with-island-scope" {:upvalue-count 1 :arity 1 :constants ("append!") :bytecode (18 0 16 0 52 0 0 2 50)} {:upvalue-count 3 :arity 0 :constants ("render-to-dom" "component-body") :bytecode (20 0 0 18 0 52 1 0 1 18 1 18 2 49 3 50)} "dom-append" "dom-set-data" "sx-disposers") :bytecode (52 0 0 0 17 4 52 1 0 0 17 5 51 3 0 1 1 1 2 1 4 1 5 1 4 0 1 5 0 1 6 0 4 52 0 0 4 16 1 52 2 0 3 5 16 0 52 8 0 1 16 2 52 7 0 2 17 6 16 0 52 9 0 1 17 7 51 11 0 1 6 1 4 16 0 52 12 0 1 52 10 0 2 5 16 0 52 13 0 1 33 37 0 20 14 0 48 0 17 8 51 15 0 1 8 1 2 1 3 16 5 52 10 0 2 5 16 6 1 17 0 16 8 52 16 0 3 32 1 0 2 5 20 18 0 1 19 0 2 48 2 17 8 52 1 0 0 17 9 20 20 0 16 8 1 21 0 16 7 48 3 5 16 4 52 23 0 1 52 22 0 1 33 19 0 20 20 0 16 8 1 24 0 16 4 52 25 0 1 48 3 32 1 0 2 5 20 26 0 16 8 1 27 0 48 2 5 20 28 0 51 29 0 1 9 51 30 0 1 0 1 6 1 3 48 2 17 10 20 31 0 16 8 16 10 48 2 5 20 32 0 16 8 1 33 0 16 9 48 3 5 16 8 50)} "render-dom-lake" {:upvalue-count 0 :arity 3 :constants ("div" "list" "reduce" {:upvalue-count 5 :arity 2 :constants ("get" "skip" "assoc" "i" "inc" "=" "type-of" "keyword" "<" "len" "keyword-name" "trampoline" "eval-expr" "nth" "id" "tag" "append!") :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 2 33 29 0 16 0 1 1 0 4 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 183 0 16 1 52 6 0 1 1 7 0 52 5 0 2 6 33 24 0 5 16 0 1 3 0 52 0 0 2 52 4 0 1 18 0 52 9 0 1 52 8 0 2 33 108 0 16 1 52 10 0 1 17 3 18 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 13 0 2 18 1 52 12 0 2 52 11 0 1 17 4 16 3 1 14 0 52 5 0 2 33 7 0 16 4 19 2 32 20 0 16 3 1 15 0 52 5 0 2 33 7 0 16 4 19 3 32 1 0 2 5 16 0 1 1 0 3 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 31 0 18 4 16 1 52 16 0 2 5 16 0 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 3 50)} "dict" "i" 0 "skip" "dom-create-element" "dom-set-attr" "data-sx-lake" "" "for-each" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)}) :bytecode (2 17 3 1 0 0 17 4 52 1 0 0 17 5 51 3 0 1 0 1 1 1 3 1 4 1 5 1 5 0 1 6 0 1 7 0 4 52 4 0 4 16 0 52 2 0 3 5 20 8 0 16 4 2 48 2 17 6 20 9 0 16 6 1 10 0 16 3 6 34 4 0 5 1 11 0 48 3 5 51 13 0 1 6 1 1 1 2 16 5 52 12 0 2 5 16 6 50)} "render-dom-marsh" {:upvalue-count 0 :arity 3 :constants ("div" "list" "reduce" {:upvalue-count 6 :arity 2 :constants ("get" "skip" "assoc" "i" "inc" "=" "type-of" "keyword" "<" "len" "keyword-name" "trampoline" "eval-expr" "nth" "id" "tag" "transform" "append!") :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 2 33 29 0 16 0 1 1 0 4 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 202 0 16 1 52 6 0 1 1 7 0 52 5 0 2 6 33 24 0 5 16 0 1 3 0 52 0 0 2 52 4 0 1 18 0 52 9 0 1 52 8 0 2 33 127 0 16 1 52 10 0 1 17 3 18 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 13 0 2 18 1 52 12 0 2 52 11 0 1 17 4 16 3 1 14 0 52 5 0 2 33 7 0 16 4 19 2 32 39 0 16 3 1 15 0 52 5 0 2 33 7 0 16 4 19 3 32 20 0 16 3 1 16 0 52 5 0 2 33 7 0 16 4 19 4 32 1 0 2 5 16 0 1 1 0 3 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 31 0 18 5 16 1 52 17 0 2 5 16 0 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 3 50)} "dict" "i" 0 "skip" "dom-create-element" "dom-set-attr" "data-sx-marsh" "" "dom-set-data" "sx-marsh-transform" "sx-marsh-env" "for-each" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)}) :bytecode (2 17 3 1 0 0 17 4 2 17 5 52 1 0 0 17 6 51 3 0 1 0 1 1 1 3 1 4 1 5 1 6 1 5 0 1 6 0 1 7 0 4 52 4 0 4 16 0 52 2 0 3 5 20 8 0 16 4 2 48 2 17 7 20 9 0 16 7 1 10 0 16 3 6 34 4 0 5 1 11 0 48 3 5 16 5 33 15 0 20 12 0 16 7 1 13 0 16 5 48 3 32 1 0 2 5 20 12 0 16 7 1 14 0 16 1 48 3 5 51 16 0 1 7 1 1 1 2 16 6 52 15 0 2 5 16 7 50)} "reactive-text" {:upvalue-count 0 :arity 1 :constants ("create-text-node" "str" "deref" "effect" {:upvalue-count 2 :arity 0 :constants ("dom-set-text-content" "str" "deref") :bytecode (20 0 0 18 0 20 2 0 18 1 48 1 52 1 0 1 49 2 50)}) :bytecode (20 0 0 20 2 0 16 0 48 1 52 1 0 1 48 1 17 1 20 3 0 51 4 0 1 1 1 0 48 1 5 16 1 50)} "reactive-attr" {:upvalue-count 0 :arity 3 :constants ("dom-get-attr" "data-sx-reactive-attrs" "" "empty?" "str" "," "dom-set-attr" "effect" {:upvalue-count 3 :arity 0 :constants ("signal?" "deref" "nil?" "=" "dom-remove-attr" "dom-set-attr" "" "str") :bytecode (18 0 48 0 17 0 20 0 0 16 0 48 1 33 10 0 20 1 0 16 0 48 1 32 2 0 16 0 17 1 16 1 52 2 0 1 6 34 8 0 5 16 1 4 52 3 0 2 33 12 0 20 4 0 18 1 18 2 49 2 32 40 0 16 1 3 52 3 0 2 33 15 0 20 5 0 18 1 18 2 1 6 0 49 3 32 15 0 20 5 0 18 1 18 2 16 1 52 7 0 1 49 3 50)}) :bytecode (20 0 0 16 0 1 1 0 48 2 6 34 4 0 5 1 2 0 17 3 16 3 52 3 0 1 33 5 0 16 1 32 11 0 16 3 1 5 0 16 1 52 4 0 3 17 4 20 6 0 16 0 1 1 0 16 4 48 3 5 20 7 0 51 8 0 1 2 1 0 1 1 49 1 50)} "reactive-spread" {:upvalue-count 0 :arity 2 :constants ("list" "dom-get-attr" "data-sx-reactive-attrs" "" "dom-set-attr" "empty?" "_spread" "str" ",_spread" "effect" {:upvalue-count 4 :arity 0 :constants ("not" "empty?" "dom-get-attr" "class" "" "filter" {:upvalue-count 0 :arity 1 :constants ("not" "=" "") :bytecode (16 0 1 2 0 52 1 0 2 52 0 0 1 50)} "split" " " {:upvalue-count 1 :arity 1 :constants ("not" "some" {:upvalue-count 1 :arity 1 :constants ("=") :bytecode (16 0 18 0 52 0 0 2 50)}) :bytecode (51 2 0 1 0 18 0 52 1 0 2 52 0 0 1 50)} "dom-remove-attr" "dom-set-attr" "join" "for-each" {:upvalue-count 1 :arity 1 :constants ("dom-remove-attr") :bytecode (20 0 0 18 0 16 0 49 2 50)} "spread?" "spread-attrs" "dict-get" {:upvalue-count 0 :arity 1 :constants ("not" "=" "class") :bytecode (16 0 1 2 0 52 1 0 2 52 0 0 1 50)} "keys" "=" "str" {:upvalue-count 2 :arity 1 :constants ("dom-set-attr" "str" "dict-get") :bytecode (20 0 0 18 0 16 0 18 1 16 0 52 2 0 2 52 1 0 1 49 3 50)} "run-post-render-hooks" "list") :bytecode (18 0 52 1 0 1 52 0 0 1 33 95 0 20 2 0 18 1 1 3 0 48 2 6 34 4 0 5 1 4 0 17 0 51 6 0 16 0 1 8 0 52 7 0 2 52 5 0 2 17 1 51 9 0 0 0 16 1 52 5 0 2 17 2 16 2 52 1 0 1 33 13 0 20 10 0 18 1 1 3 0 48 2 32 19 0 20 11 0 18 1 1 3 0 1 8 0 16 2 52 12 0 2 48 3 32 1 0 2 5 51 14 0 0 1 18 2 52 13 0 2 5 18 3 48 0 17 0 16 0 52 15 0 1 33 179 0 16 0 52 16 0 1 17 1 16 1 1 3 0 52 17 0 2 6 34 4 0 5 1 4 0 17 2 51 6 0 16 2 1 8 0 52 7 0 2 52 5 0 2 17 3 51 18 0 16 1 52 19 0 1 52 5 0 2 17 4 16 3 19 0 5 16 4 19 2 5 16 3 52 1 0 1 52 0 0 1 33 72 0 20 2 0 18 1 1 3 0 48 2 6 34 4 0 5 1 4 0 17 5 20 11 0 18 1 1 3 0 16 5 6 33 14 0 5 16 5 1 4 0 52 20 0 2 52 0 0 1 33 14 0 16 5 1 8 0 16 2 52 21 0 3 32 2 0 16 2 48 3 32 1 0 2 5 51 22 0 0 1 1 1 16 4 52 13 0 2 5 20 23 0 49 0 32 13 0 52 24 0 0 19 0 5 52 24 0 0 19 2 50)}) :bytecode (52 0 0 0 17 2 52 0 0 0 17 3 20 1 0 16 0 1 2 0 48 2 6 34 4 0 5 1 3 0 17 4 20 4 0 16 0 1 2 0 16 4 52 5 0 1 33 6 0 1 6 0 32 9 0 16 4 1 8 0 52 7 0 2 48 3 5 20 9 0 51 10 0 1 2 1 0 1 3 1 1 49 1 50)} "reactive-fragment" {:upvalue-count 0 :arity 4 :constants ("create-comment" "island-fragment" "list" "effect" {:upvalue-count 4 :arity 0 :constants ("for-each" {:upvalue-count 0 :arity 1 :constants ("dom-remove") :bytecode (20 0 0 16 0 49 1 50)} "list" "dom-child-nodes" "dom-insert-after") :bytecode (51 1 0 18 0 52 0 0 2 5 52 2 0 0 19 0 5 18 1 48 0 33 28 0 18 2 48 0 17 0 20 3 0 16 0 48 1 19 0 5 20 4 0 18 3 16 0 49 2 32 1 0 2 50)}) :bytecode (20 0 0 1 1 0 48 1 17 4 52 2 0 0 17 5 20 3 0 51 4 0 1 5 1 0 1 1 1 4 48 1 5 16 4 50)} "render-list-item" {:upvalue-count 0 :arity 4 :constants ("lambda?" "render-lambda-dom" "list" "render-to-dom" "apply") :bytecode (16 0 52 0 0 1 33 20 0 20 1 0 16 0 16 1 52 2 0 1 16 2 16 3 49 4 32 21 0 20 3 0 16 0 16 1 52 2 0 1 52 4 0 2 16 2 16 3 49 3 50)} "extract-key" {:upvalue-count 0 :arity 2 :constants ("dom-get-attr" "key" "dom-remove-attr" "dom-get-data" "str" "__idx_") :bytecode (20 0 0 16 0 1 1 0 48 2 17 2 16 2 33 16 0 20 2 0 16 0 1 1 0 48 2 5 16 2 32 35 0 20 3 0 16 0 1 1 0 48 2 17 3 16 3 33 9 0 16 3 52 4 0 1 32 9 0 1 5 0 16 1 52 4 0 2 50)} "reactive-list" {:upvalue-count 0 :arity 4 :constants ("create-fragment" "create-comment" "island-list" "dict" "list" "dom-append" "effect" {:upvalue-count 8 :arity 0 :constants ("deref" "dom-parent" "dict" "list" "for-each-indexed" {:upvalue-count 7 :arity 2 :constants ("render-list-item" "extract-key" "not" "starts-with?" "__idx_" "dict-has?" "dict-set!" "dict-get" "append!") :bytecode (20 0 0 18 0 16 1 18 1 18 2 48 4 17 2 20 1 0 16 2 16 0 48 2 17 3 18 3 52 2 0 1 6 33 14 0 5 16 3 1 4 0 52 3 0 2 52 2 0 1 33 6 0 3 19 3 32 1 0 2 5 18 4 16 3 52 5 0 2 33 19 0 18 5 16 3 18 4 16 3 52 7 0 2 52 6 0 3 32 10 0 18 5 16 3 16 2 52 6 0 3 5 18 6 16 3 52 8 0 2 50)} "not" "dom-remove-children-after" "create-fragment" "for-each" {:upvalue-count 2 :arity 1 :constants ("dom-append" "dict-get") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 2 49 2 50)} "dom-insert-after" {:upvalue-count 2 :arity 1 :constants ("not" "dict-has?" "dom-remove" "dict-get") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 16 0 20 2 0 18 1 16 0 52 3 0 2 49 1 32 1 0 2 50)} {:upvalue-count 2 :arity 1 :constants ("dict-get" "dom-next-sibling" "not" "identical?" "dom-insert-after") :bytecode (18 0 16 0 52 0 0 2 17 1 20 1 0 18 1 48 1 17 2 16 1 16 2 52 3 0 2 52 2 0 1 33 12 0 20 4 0 18 1 16 1 48 2 32 1 0 2 5 16 1 19 1 50)} {:upvalue-count 6 :arity 2 :constants ("render-list-item" "extract-key" "dict-set!" "append!" "dom-append") :bytecode (20 0 0 18 0 16 1 18 1 18 2 48 4 17 2 20 1 0 16 2 16 0 48 2 17 3 18 3 16 3 16 2 52 2 0 3 5 18 4 16 3 52 3 0 2 5 20 4 0 18 5 16 2 49 2 50)}) :bytecode (20 0 0 18 0 48 1 17 0 20 1 0 18 1 48 1 33 133 0 52 2 0 0 17 1 52 3 0 0 17 2 4 17 3 51 5 0 0 2 0 3 0 4 1 3 0 5 1 1 1 2 16 0 52 4 0 2 5 16 3 52 6 0 1 33 41 0 20 7 0 18 1 48 1 5 20 8 0 48 0 17 4 51 10 0 1 4 1 1 16 2 52 9 0 2 5 20 11 0 18 1 16 4 48 2 32 31 0 51 12 0 1 1 0 5 18 6 52 9 0 2 5 18 1 17 4 51 13 0 1 1 1 4 16 2 52 9 0 2 5 16 1 19 5 5 16 2 19 6 32 21 0 51 14 0 0 2 0 3 0 4 0 5 0 6 0 7 16 0 52 4 0 2 50)}) :bytecode (20 0 0 48 0 17 4 20 1 0 1 2 0 48 1 17 5 52 3 0 0 17 6 52 4 0 0 17 7 20 5 0 16 4 16 5 48 2 5 20 6 0 51 7 0 1 1 1 5 1 0 1 2 1 3 1 6 1 7 1 4 48 1 5 16 4 50)} "bind-input" {:upvalue-count 0 :arity 2 :constants ("lower" "dom-get-attr" "type" "" "=" "checkbox" "radio" "dom-set-prop" "checked" "deref" "value" "str" "effect" {:upvalue-count 3 :arity 0 :constants ("dom-set-prop" "checked" "deref" "str" "!=" "dom-get-prop" "value") :bytecode (18 0 33 20 0 20 0 0 18 1 1 1 0 20 2 0 18 2 48 1 49 3 32 48 0 20 2 0 18 2 48 1 52 3 0 1 17 0 20 5 0 18 1 1 6 0 48 2 16 0 52 4 0 2 33 15 0 20 0 0 18 1 1 6 0 16 0 49 3 32 1 0 2 50)} "dom-on" "change" "input" {:upvalue-count 3 :arity 1 :constants ("reset!" "dom-get-prop" "checked" "value") :bytecode (18 0 33 20 0 20 0 0 18 1 20 1 0 18 2 1 2 0 48 2 49 2 32 17 0 20 0 0 18 1 20 1 0 18 2 1 3 0 48 2 49 2 50)}) :bytecode (20 1 0 16 0 1 2 0 48 2 6 34 4 0 5 1 3 0 52 0 0 1 17 2 16 2 1 5 0 52 4 0 2 6 34 10 0 5 16 2 1 6 0 52 4 0 2 17 3 16 3 33 20 0 20 7 0 16 0 1 8 0 20 9 0 16 1 48 1 48 3 32 21 0 20 7 0 16 0 1 10 0 20 9 0 16 1 48 1 52 11 0 1 48 3 5 20 12 0 51 13 0 1 3 1 0 1 1 48 1 5 20 14 0 16 0 16 3 33 6 0 1 15 0 32 3 0 1 16 0 51 17 0 1 3 1 1 1 0 49 3 50)} "*use-cek-reactive*" "enable-cek-reactive!" {:upvalue-count 0 :arity 0 :constants ("*use-cek-reactive*") :bytecode (3 21 0 0 50)} "cek-reactive-text" {:upvalue-count 0 :arity 2 :constants ("create-text-node" "" {:upvalue-count 1 :arity 1 :constants ("dom-set-text-content" "str") :bytecode (20 0 0 18 0 16 0 52 1 0 1 49 2 50)} "cek-run" "make-cek-state" "list" "make-reactive-reset-frame" "dom-set-text-content" "str") :bytecode (20 0 0 1 1 0 48 1 17 2 51 2 0 1 2 17 3 20 3 0 20 4 0 16 0 16 1 20 6 0 16 1 16 3 3 48 3 52 5 0 1 48 3 48 1 17 4 20 7 0 16 2 16 4 52 8 0 1 48 2 5 16 2 50)} "cek-reactive-attr" {:upvalue-count 0 :arity 4 :constants ({:upvalue-count 2 :arity 1 :constants ("nil?" "=" "dom-remove-attr" "dom-set-attr" "" "str") :bytecode (16 0 52 0 0 1 6 34 8 0 5 16 0 4 52 1 0 2 33 12 0 20 2 0 18 0 18 1 49 2 32 40 0 16 0 3 52 1 0 2 33 15 0 20 3 0 18 0 18 1 1 4 0 49 3 32 15 0 20 3 0 18 0 18 1 16 0 52 5 0 1 49 3 50)} "dom-get-attr" "data-sx-reactive-attrs" "" "empty?" "str" "," "dom-set-attr" "cek-run" "make-cek-state" "list" "make-reactive-reset-frame" "cek-call") :bytecode (51 0 0 1 0 1 1 17 4 20 1 0 16 0 1 2 0 48 2 6 34 4 0 5 1 3 0 17 5 16 5 52 4 0 1 33 5 0 16 1 32 11 0 16 5 1 6 0 16 1 52 5 0 3 17 6 20 7 0 16 0 1 2 0 16 6 48 3 5 20 8 0 20 9 0 16 2 16 3 20 11 0 16 3 16 4 3 48 3 52 10 0 1 48 3 48 1 17 5 16 4 16 5 52 10 0 1 52 12 0 2 50)} "render-dom-portal" {:upvalue-count 0 :arity 3 :constants ("trampoline" "eval-expr" "first" "dom-query" "dom-ensure-element" "not" "create-comment" "str" "portal: " " (not found)" "create-fragment" "for-each" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)} "rest" "dom-child-nodes" "dom-append" "register-in-scope" {:upvalue-count 1 :arity 0 :constants ("for-each" {:upvalue-count 0 :arity 1 :constants ("dom-remove") :bytecode (20 0 0 16 0 49 1 50)}) :bytecode (51 1 0 18 0 52 0 0 2 50)}) :bytecode (16 0 52 2 0 1 16 1 52 1 0 2 52 0 0 1 17 3 20 3 0 16 3 48 1 6 34 8 0 5 20 4 0 16 3 48 1 17 4 16 4 52 5 0 1 33 20 0 20 6 0 1 8 0 16 3 1 9 0 52 7 0 3 49 1 32 75 0 20 6 0 1 8 0 16 3 52 7 0 2 48 1 17 5 20 10 0 48 0 17 6 51 12 0 1 6 1 1 1 2 16 0 52 13 0 1 52 11 0 2 5 20 14 0 16 6 48 1 17 7 20 15 0 16 4 16 6 48 2 5 20 16 0 51 17 0 1 7 48 1 5 16 5 50)} "render-dom-error-boundary" {:upvalue-count 0 :arity 3 :constants (">" "len" 1 "first" "rest" "dom-create-element" "div" "signal" 0 "dom-set-attr" "data-sx-boundary" "true" "effect" {:upvalue-count 6 :arity 0 :constants ("deref" "dom-set-prop" "innerHTML" "" "scope-push!" "sx-island-scope" "try-catch" {:upvalue-count 4 :arity 0 :constants ("create-fragment" "for-each" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)} "dom-append" "scope-pop!" "sx-island-scope") :bytecode (20 0 0 48 0 17 0 51 2 0 1 0 0 0 0 1 18 2 52 1 0 2 5 20 3 0 18 3 16 0 48 2 5 1 5 0 52 4 0 1 50)} {:upvalue-count 5 :arity 1 :constants ("scope-pop!" "sx-island-scope" "trampoline" "eval-expr" {:upvalue-count 1 :arity 0 :constants ("swap!" {:upvalue-count 0 :arity 1 :constants ("+" 1) :bytecode (16 0 1 1 0 52 0 0 2 50)}) :bytecode (20 0 0 18 0 51 1 0 49 2 50)} "nil?" "dom-create-element" "div" "dom-set-attr" "class" "sx-render-error" "style" "color:red;font-size:0.875rem;padding:0.5rem;border:1px solid red;border-radius:0.25rem;margin:0.5rem 0;" "dom-set-text-content" "str" "Render error: " "lambda?" "render-lambda-dom" "list" "render-to-dom" "apply" "dom-append") :bytecode (1 1 0 52 0 0 1 5 18 0 18 1 52 3 0 2 52 2 0 1 17 1 51 4 0 0 2 17 2 16 1 52 5 0 1 33 61 0 20 6 0 1 7 0 2 48 2 17 4 20 8 0 16 4 1 9 0 1 10 0 48 3 5 20 8 0 16 4 1 11 0 1 12 0 48 3 5 20 13 0 16 4 1 15 0 16 0 52 14 0 2 48 2 5 16 4 32 54 0 16 1 52 16 0 1 33 22 0 20 17 0 16 1 16 0 16 2 52 18 0 2 18 1 18 3 48 4 32 23 0 20 19 0 16 1 16 0 16 2 52 18 0 2 52 20 0 2 18 1 18 3 48 3 17 3 20 21 0 18 4 16 3 49 2 50)}) :bytecode (20 0 0 18 0 48 1 5 20 1 0 18 1 1 2 0 1 3 0 48 3 5 1 5 0 2 52 4 0 2 5 51 7 0 0 2 0 3 0 4 0 1 51 8 0 0 5 0 2 0 0 0 3 0 1 52 6 0 2 50)}) :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 9 0 16 0 52 3 0 1 32 1 0 2 17 3 16 0 52 1 0 1 1 2 0 52 0 0 2 33 9 0 16 0 52 4 0 1 32 2 0 16 0 17 4 20 5 0 1 6 0 2 48 2 17 5 20 7 0 1 8 0 48 1 17 6 20 9 0 16 5 1 10 0 1 11 0 48 3 5 20 12 0 51 13 0 1 6 1 5 1 1 1 2 1 4 1 3 48 1 5 16 5 50)}) :bytecode (1 1 0 128 0 0 5 1 3 0 128 2 0 5 51 5 0 128 4 0 5 52 7 0 0 128 6 0 5 1 9 0 128 8 0 5 51 11 0 128 10 0 5 51 13 0 128 12 0 5 51 15 0 128 14 0 5 51 17 0 128 16 0 5 51 19 0 128 18 0 5 51 21 0 128 20 0 5 51 23 0 128 22 0 5 51 25 0 128 24 0 5 51 27 0 128 26 0 5 51 29 0 128 28 0 5 1 32 0 1 33 0 1 34 0 1 35 0 1 36 0 1 37 0 1 38 0 1 39 0 1 40 0 1 41 0 1 42 0 1 43 0 1 44 0 1 45 0 1 46 0 1 47 0 1 48 0 1 49 0 1 50 0 1 51 0 1 52 0 1 53 0 1 54 0 52 31 0 23 128 30 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 3 128 83 0 5 51 85 0 128 84 0 5 51 87 0 128 86 0 5 51 89 0 128 88 0 5 51 91 0 128 90 0 5 51 93 0 128 92 0 50))) + :constants ({:library (sx dom) :op "import"} {:library (sx render) :op "import"} "SVG_NS" "http://www.w3.org/2000/svg" "MATH_NS" "http://www.w3.org/1998/Math/MathML" "island-scope?" {:upvalue-count 0 :arity 0 :constants ("not" "nil?" "scope-peek" "sx-island-scope") :bytecode (1 3 0 52 2 0 1 52 1 0 1 52 0 0 1 50)} "*memo-cache*" "dict" "*cyst-counter*" 0 "next-cyst-id" {:upvalue-count 0 :arity 0 :constants ("+" "*cyst-counter*" 1 "str" "sx-cyst-") :bytecode (20 1 0 1 2 0 52 0 0 2 21 1 0 5 1 4 0 20 1 0 52 3 0 2 50)} "contains-deref?" {:upvalue-count 0 :arity 1 :constants ("not" "list?" "empty?" "=" "type-of" "first" "symbol" "symbol-name" "deref" "some" "contains-deref?") :bytecode (16 0 52 1 0 1 52 0 0 1 33 4 0 4 32 68 0 16 0 52 2 0 1 33 4 0 4 32 55 0 16 0 52 5 0 1 52 4 0 1 1 6 0 52 3 0 2 6 33 18 0 5 16 0 52 5 0 1 52 7 0 1 1 8 0 52 3 0 2 33 4 0 3 32 9 0 20 10 0 16 0 52 9 0 2 50)} "dom-on" {:upvalue-count 0 :arity 3 :constants ("dom-listen" "lambda?" "=" 0 "len" "lambda-params" {:upvalue-count 1 :arity 1 :constants ("trampoline" "call-lambda" "list" "run-post-render-hooks") :bytecode (18 0 52 2 0 0 52 1 0 2 52 0 0 1 5 20 3 0 49 0 50)} {:upvalue-count 1 :arity 1 :constants ("trampoline" "call-lambda" "list" "run-post-render-hooks") :bytecode (18 0 16 0 52 2 0 1 52 1 0 2 52 0 0 1 5 20 3 0 49 0 50)}) :bytecode (20 0 0 16 0 16 1 16 2 52 1 0 1 33 36 0 1 3 0 16 2 52 5 0 1 52 4 0 1 52 2 0 2 33 8 0 51 6 0 1 2 32 5 0 51 7 0 1 2 32 2 0 16 2 49 3 50)} "render-to-dom" {:upvalue-count 0 :arity 3 :constants ("set-render-active!" "type-of" "nil" "=" "create-fragment" "boolean" "raw-html" "dom-parse-html" "raw-html-content" "string" "create-text-node" "number" "str" "symbol" "render-to-dom" "trampoline" "eval-expr" "keyword" "keyword-name" "dom-node" "spread" "not" "island-scope?" "scope-emit!" "element-attrs" "spread-attrs" "dict" "has-key?" "__host_handle" "list" "empty?" "render-dom-list" "signal?" "reactive-text" "deref") :bytecode (3 52 0 0 1 5 16 0 52 1 0 1 6 1 2 0 52 3 0 2 33 9 0 5 20 4 0 49 0 32 103 1 6 1 5 0 52 3 0 2 33 9 0 5 20 4 0 49 0 32 83 1 6 1 6 0 52 3 0 2 33 15 0 5 20 7 0 16 0 52 8 0 1 49 1 32 57 1 6 1 9 0 52 3 0 2 33 11 0 5 20 10 0 16 0 49 1 32 35 1 6 1 11 0 52 3 0 2 33 15 0 5 20 10 0 16 0 52 12 0 1 49 1 32 9 1 6 1 13 0 52 3 0 2 33 25 0 5 20 14 0 16 0 16 1 52 16 0 2 52 15 0 1 16 1 16 2 49 3 32 229 0 6 1 17 0 52 3 0 2 33 15 0 5 20 10 0 16 0 52 18 0 1 49 1 32 203 0 6 1 19 0 52 3 0 2 33 6 0 5 16 0 32 186 0 6 1 20 0 52 3 0 2 33 36 0 5 20 22 0 48 0 52 21 0 1 33 16 0 1 24 0 16 0 52 25 0 1 52 23 0 2 32 1 0 2 5 16 0 32 139 0 6 1 26 0 52 3 0 2 33 26 0 5 16 0 1 28 0 52 27 0 2 33 5 0 16 0 32 5 0 20 4 0 49 0 32 102 0 6 1 29 0 52 3 0 2 33 32 0 5 16 0 52 30 0 1 33 8 0 20 4 0 49 0 32 11 0 20 31 0 16 0 16 1 16 2 49 3 32 59 0 5 20 32 0 16 0 48 1 33 37 0 20 22 0 48 0 33 10 0 20 33 0 16 0 49 1 32 16 0 20 10 0 20 34 0 16 0 48 1 52 12 0 1 49 1 32 11 0 20 10 0 16 0 52 12 0 1 49 1 50)} "render-dom-list" {:upvalue-count 0 :arity 3 :constants ("first" "=" "type-of" "symbol" "symbol-name" "rest" "raw!" "render-dom-raw" "<>" "render-dom-fragment" "lake" "render-dom-lake" "marsh" "render-dom-marsh" "starts-with?" "html:" "render-dom-element" "slice" 5 "render-dom-form?" "contains?" "HTML_TAGS" ">" "len" 0 "keyword" "dispatch-render-form" "env-has?" "macro?" "env-get" "render-to-dom" "expand-macro" "~" "island?" "scope-peek" "sx-render-markers" "dom-create-element" "span" "dict" "reduce" {:upvalue-count 3 :arity 2 :constants ("get" "skip" "assoc" "i" "inc" "=" "type-of" "keyword" "<" "len" "keyword-name" "trampoline" "eval-expr" "nth" "dict-set!") :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 2 33 29 0 16 0 1 1 0 4 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 145 0 16 1 52 6 0 1 1 7 0 52 5 0 2 6 33 24 0 5 16 0 1 3 0 52 0 0 2 52 4 0 1 18 0 52 9 0 1 52 8 0 2 33 79 0 16 1 52 10 0 1 17 3 18 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 13 0 2 18 1 52 12 0 2 52 11 0 1 17 4 18 2 16 3 16 4 52 14 0 3 5 16 0 1 1 0 3 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 22 0 16 0 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 3 50)} "i" "skip" "dom-set-attr" "data-sx-island" "component-name" "not" "empty-dict?" "data-sx-state" "sx-serialize" "render-dom-island" "component?" "render-dom-component" "render-dom-unknown-component" "index-of" "-" "deref" "island-scope?" "trampoline" "eval-expr" "signal?" "reactive-text" "create-text-node" "str" "contains-deref?" "computed" {:upvalue-count 2 :arity 0 :constants ("trampoline" "eval-expr") :bytecode (18 0 18 1 52 1 0 2 52 0 0 1 50)} "lambda?" "list" "create-fragment" "for-each" {:upvalue-count 3 :arity 1 :constants ("render-to-dom" "not" "spread?" "dom-append") :bytecode (20 0 0 16 0 18 0 18 1 48 3 17 1 16 1 52 2 0 1 52 1 0 1 33 12 0 20 3 0 18 2 16 1 49 2 32 1 0 2 50)}) :bytecode (16 0 52 0 0 1 17 3 16 3 52 2 0 1 1 3 0 52 1 0 2 33 53 3 16 3 52 4 0 1 17 4 16 0 52 5 0 1 17 5 16 4 1 6 0 52 1 0 2 33 12 0 20 7 0 16 5 16 1 49 2 32 10 3 16 4 1 8 0 52 1 0 2 33 14 0 20 9 0 16 5 16 1 16 2 49 3 32 240 2 16 4 1 10 0 52 1 0 2 33 14 0 20 11 0 16 5 16 1 16 2 49 3 32 214 2 16 4 1 12 0 52 1 0 2 33 14 0 20 13 0 16 5 16 1 16 2 49 3 32 188 2 16 4 1 15 0 52 14 0 2 33 23 0 20 16 0 16 4 1 18 0 52 17 0 2 16 5 16 1 16 2 49 4 32 153 2 20 19 0 16 4 48 1 33 91 0 20 21 0 16 4 52 20 0 2 6 33 43 0 5 16 5 52 23 0 1 1 24 0 52 22 0 2 6 33 18 0 5 16 5 52 0 0 1 52 2 0 1 1 25 0 52 1 0 2 6 34 3 0 5 16 2 33 16 0 20 16 0 16 4 16 5 16 1 16 2 49 4 32 13 0 20 26 0 16 4 16 0 16 1 16 2 49 4 32 52 2 16 1 16 4 52 27 0 2 6 33 13 0 5 16 1 16 4 52 29 0 2 52 28 0 1 33 28 0 20 30 0 16 1 16 4 52 29 0 2 16 5 16 1 52 31 0 3 16 1 16 2 49 3 32 252 1 20 21 0 16 4 52 20 0 2 33 16 0 20 16 0 16 4 16 5 16 1 16 2 49 4 32 224 1 16 4 1 32 0 52 14 0 2 6 33 26 0 5 16 1 16 4 52 27 0 2 6 33 13 0 5 16 1 16 4 52 29 0 2 52 33 0 1 33 145 0 1 35 0 52 34 0 1 33 113 0 16 1 16 4 52 29 0 2 17 6 20 36 0 1 37 0 2 48 2 17 7 52 38 0 0 17 8 51 40 0 1 5 1 1 1 8 1 41 0 1 24 0 1 42 0 4 52 38 0 4 16 5 52 39 0 3 5 20 43 0 16 7 1 44 0 16 6 52 45 0 1 48 3 5 16 8 52 47 0 1 52 46 0 1 33 19 0 20 43 0 16 7 1 48 0 16 8 52 49 0 1 48 3 32 1 0 2 5 16 7 32 19 0 20 50 0 16 1 16 4 52 29 0 2 16 5 16 1 16 2 49 4 32 37 1 16 4 1 32 0 52 14 0 2 33 45 0 16 1 16 4 52 29 0 2 17 6 16 6 52 51 0 1 33 16 0 20 52 0 16 6 16 5 16 1 16 2 49 4 32 7 0 20 53 0 16 4 49 1 32 236 0 16 4 1 55 0 52 54 0 2 1 24 0 52 22 0 2 6 33 36 0 5 16 5 52 23 0 1 1 24 0 52 22 0 2 6 33 18 0 5 16 5 52 0 0 1 52 2 0 1 1 25 0 52 1 0 2 33 16 0 20 16 0 16 4 16 5 16 1 16 2 49 4 32 161 0 16 2 33 16 0 20 16 0 16 4 16 5 16 1 16 2 49 4 32 140 0 16 4 1 56 0 52 1 0 2 6 33 6 0 5 20 57 0 48 0 33 57 0 16 5 52 0 0 1 16 1 52 59 0 2 52 58 0 1 17 6 20 60 0 16 6 48 1 33 10 0 20 61 0 16 6 49 1 32 16 0 20 62 0 20 56 0 16 6 48 1 52 63 0 1 49 1 32 61 0 20 57 0 48 0 6 33 8 0 5 20 64 0 16 0 48 1 33 20 0 20 61 0 20 65 0 51 66 0 1 0 1 1 48 1 49 1 32 21 0 20 30 0 16 0 16 1 52 59 0 2 52 58 0 1 16 1 16 2 49 3 32 76 0 16 3 52 67 0 1 6 34 14 0 5 16 3 52 2 0 1 1 68 0 52 1 0 2 33 24 0 20 30 0 16 0 16 1 52 59 0 2 52 58 0 1 16 1 16 2 49 3 32 25 0 20 69 0 48 0 17 4 51 71 0 1 1 1 2 1 4 16 0 52 70 0 2 5 16 4 50)} "render-dom-element" {:upvalue-count 0 :arity 4 :constants ("=" "svg" "SVG_NS" "math" "MATH_NS" "dom-create-element" "scope-push!" "element-attrs" "reduce" {:upvalue-count 5 :arity 2 :constants ("get" "skip" "assoc" "i" "inc" "=" "type-of" "keyword" "<" "len" "keyword-name" "nth" "starts-with?" "on-" "trampoline" "eval-expr" "callable?" "dom-on" "slice" 3 "bind" "signal?" "bind-input" "ref" "dict-set!" "current" "key" "dom-set-attr" "str" "island-scope?" "reactive-attr" {:upvalue-count 2 :arity 0 :constants ("trampoline" "eval-expr") :bytecode (18 0 18 1 52 1 0 2 52 0 0 1 50)} "nil?" "contains?" "BOOLEAN_ATTRS" "" "not" "VOID_ELEMENTS" "render-to-dom" "spread?" "reactive-spread" {:upvalue-count 3 :arity 0 :constants ("render-to-dom") :bytecode (20 0 0 18 0 18 1 18 2 49 3 50)} "dom-append") :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 2 33 29 0 16 0 1 1 0 4 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 47 2 16 1 52 6 0 1 1 7 0 52 5 0 2 6 33 24 0 5 16 0 1 3 0 52 0 0 2 52 4 0 1 18 0 52 9 0 1 52 8 0 2 33 143 1 16 1 52 10 0 1 17 3 18 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 11 0 2 17 4 16 3 1 13 0 52 12 0 2 33 49 0 16 4 18 1 52 15 0 2 52 14 0 1 17 5 20 16 0 16 5 48 1 33 21 0 20 17 0 18 2 16 3 1 19 0 52 18 0 2 16 5 48 3 32 1 0 2 32 23 1 16 3 1 20 0 52 5 0 2 33 40 0 16 4 18 1 52 15 0 2 52 14 0 1 17 5 20 21 0 16 5 48 1 33 12 0 20 22 0 18 2 16 5 48 2 32 1 0 2 32 227 0 16 3 1 23 0 52 5 0 2 33 28 0 16 4 18 1 52 15 0 2 52 14 0 1 17 5 16 5 1 25 0 18 2 52 24 0 3 32 187 0 16 3 1 26 0 52 5 0 2 33 33 0 16 4 18 1 52 15 0 2 52 14 0 1 17 5 20 27 0 18 2 1 26 0 16 5 52 28 0 1 48 3 32 142 0 20 29 0 48 0 33 19 0 20 30 0 18 2 16 3 51 31 0 1 4 0 1 48 3 32 115 0 16 4 18 1 52 15 0 2 52 14 0 1 17 5 16 5 52 32 0 1 6 34 8 0 5 16 5 4 52 5 0 2 33 4 0 2 32 76 0 20 34 0 16 3 52 33 0 2 33 24 0 16 5 33 15 0 20 27 0 18 2 16 3 1 35 0 48 3 32 1 0 2 32 40 0 16 5 3 52 5 0 2 33 15 0 20 27 0 18 2 16 3 1 35 0 48 3 32 15 0 20 27 0 18 2 16 3 16 5 52 28 0 1 48 3 5 16 0 1 1 0 3 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 116 0 20 37 0 18 3 52 33 0 2 52 36 0 1 33 76 0 20 38 0 16 1 18 1 18 4 48 3 17 3 16 3 52 39 0 1 6 33 6 0 5 20 29 0 48 0 33 19 0 20 40 0 18 2 51 41 0 1 1 0 1 0 4 48 2 32 22 0 16 3 52 39 0 1 33 4 0 2 32 9 0 20 42 0 18 2 16 3 48 2 32 1 0 2 5 16 0 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 3 50)} "dict" "i" 0 "skip" "for-each" {:upvalue-count 1 :arity 1 :constants ("for-each" {:upvalue-count 2 :arity 1 :constants ("dict-get" "=" "class" "dom-get-attr" "dom-set-attr" "not" "" "str" " " "style" ";") :bytecode (18 0 16 0 52 0 0 2 17 1 16 0 1 2 0 52 1 0 2 33 64 0 20 3 0 18 1 1 2 0 48 2 17 2 20 4 0 18 1 1 2 0 16 2 6 33 14 0 5 16 2 1 6 0 52 1 0 2 52 5 0 1 33 14 0 16 2 1 8 0 16 1 52 7 0 3 32 2 0 16 1 49 3 32 91 0 16 0 1 9 0 52 1 0 2 33 64 0 20 3 0 18 1 1 9 0 48 2 17 2 20 4 0 18 1 1 9 0 16 2 6 33 14 0 5 16 2 1 6 0 52 1 0 2 52 5 0 1 33 14 0 16 2 1 10 0 16 1 52 7 0 3 32 2 0 16 1 49 3 32 15 0 20 4 0 18 1 16 0 16 1 52 7 0 1 49 3 50)} "keys") :bytecode (51 1 0 1 0 0 0 16 0 52 2 0 1 52 0 0 2 50)} "scope-emitted" "scope-pop!") :bytecode (16 0 1 1 0 52 0 0 2 33 6 0 20 2 0 32 20 0 16 0 1 3 0 52 0 0 2 33 6 0 20 4 0 32 2 0 16 3 17 4 20 5 0 16 0 16 4 48 2 17 5 1 7 0 2 52 6 0 2 5 51 9 0 1 1 1 2 1 5 1 0 1 4 1 11 0 1 12 0 1 13 0 4 52 10 0 4 16 1 52 8 0 3 5 51 15 0 1 5 1 7 0 52 16 0 1 52 14 0 2 5 1 7 0 52 17 0 1 5 16 5 50)} "render-dom-component" {:upvalue-count 0 :arity 4 :constants ("dict" "list" "reduce" {:upvalue-count 4 :arity 2 :constants ("get" "skip" "assoc" "i" "inc" "=" "type-of" "keyword" "<" "len" "trampoline" "eval-expr" "nth" "dict-set!" "keyword-name" "append!") :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 2 33 29 0 16 0 1 1 0 4 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 150 0 16 1 52 6 0 1 1 7 0 52 5 0 2 6 33 24 0 5 16 0 1 3 0 52 0 0 2 52 4 0 1 18 0 52 9 0 1 52 8 0 2 33 75 0 18 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 12 0 2 18 1 52 11 0 2 52 10 0 1 17 3 18 2 16 1 52 14 0 1 16 3 52 13 0 3 5 16 0 1 1 0 3 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 31 0 18 3 16 1 52 15 0 2 5 16 0 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 3 50)} "i" 0 "skip" "env-merge" "component-closure" "for-each" {:upvalue-count 2 :arity 1 :constants ("env-bind!" "dict-has?" "dict-get") :bytecode (18 0 16 0 18 1 16 0 52 1 0 2 33 11 0 18 1 16 0 52 2 0 2 32 1 0 2 52 0 0 3 50)} "component-params" "component-has-children?" "create-fragment" {:upvalue-count 3 :arity 1 :constants ("render-to-dom" "not" "spread?" "dom-append") :bytecode (20 0 0 16 0 18 0 18 1 48 3 17 1 16 1 52 2 0 1 52 1 0 1 33 12 0 20 3 0 18 2 16 1 49 2 32 1 0 2 50)} "env-bind!" "children" "render-to-dom" "component-body") :bytecode (52 0 0 0 17 4 52 1 0 0 17 5 51 3 0 1 1 1 2 1 4 1 5 1 4 0 1 5 0 1 6 0 4 52 0 0 4 16 1 52 2 0 3 5 16 0 52 8 0 1 16 2 52 7 0 2 17 6 51 10 0 1 6 1 4 16 0 52 11 0 1 52 9 0 2 5 16 0 52 12 0 1 33 37 0 20 13 0 48 0 17 7 51 14 0 1 2 1 3 1 7 16 5 52 9 0 2 5 16 6 1 16 0 16 7 52 15 0 3 32 1 0 2 5 20 17 0 16 0 52 18 0 1 16 6 16 3 49 3 50)} "render-dom-fragment" {:upvalue-count 0 :arity 3 :constants ("create-fragment" "for-each" {:upvalue-count 3 :arity 1 :constants ("render-to-dom" "not" "spread?" "dom-append") :bytecode (20 0 0 16 0 18 0 18 1 48 3 17 1 16 1 52 2 0 1 52 1 0 1 33 12 0 20 3 0 18 2 16 1 49 2 32 1 0 2 50)}) :bytecode (20 0 0 48 0 17 3 51 2 0 1 1 1 2 1 3 16 0 52 1 0 2 5 16 3 50)} "render-dom-raw" {:upvalue-count 0 :arity 2 :constants ("create-fragment" "for-each" {:upvalue-count 2 :arity 1 :constants ("trampoline" "eval-expr" "=" "type-of" "string" "dom-append" "dom-parse-html" "dom-node" "dom-clone" "not" "nil?" "create-text-node" "str") :bytecode (16 0 18 0 52 1 0 2 52 0 0 1 17 1 16 1 52 3 0 1 1 4 0 52 2 0 2 33 17 0 20 5 0 18 1 20 6 0 16 1 48 1 49 2 32 68 0 16 1 52 3 0 1 1 7 0 52 2 0 2 33 17 0 20 5 0 18 1 20 8 0 16 1 48 1 49 2 32 35 0 16 1 52 10 0 1 52 9 0 1 33 21 0 20 5 0 18 1 20 11 0 16 1 52 12 0 1 48 1 49 2 32 1 0 2 50)}) :bytecode (20 0 0 48 0 17 2 51 2 0 1 1 1 2 16 0 52 1 0 2 5 16 2 50)} "render-dom-unknown-component" {:upvalue-count 0 :arity 1 :constants ("error" "str" "Unknown component: ") :bytecode (1 2 0 16 0 52 1 0 2 52 0 0 1 50)} "RENDER_DOM_FORMS" "list" "if" "when" "cond" "case" "let" "let*" "letrec" "begin" "do" "define" "defcomp" "defisland" "defmacro" "defstyle" "map" "map-indexed" "filter" "for-each" "portal" "error-boundary" "scope" "provide" "cyst" "render-dom-form?" {:upvalue-count 0 :arity 1 :constants ("contains?" "RENDER_DOM_FORMS") :bytecode (20 1 0 16 0 52 0 0 2 50)} "dispatch-render-form" {:upvalue-count 0 :arity 4 :constants ("=" "if" "island-scope?" "create-comment" "r-if" "list" "effect" {:upvalue-count 6 :arity 0 :constants ("trampoline" "eval-expr" "nth" 1 "render-to-dom" 2 ">" "len" 3 "create-fragment" "dom-parent" "for-each" {:upvalue-count 0 :arity 1 :constants ("dom-remove") :bytecode (20 0 0 16 0 49 1 50)} "dom-is-fragment?" "dom-child-nodes" "list" "dom-insert-after") :bytecode (18 0 1 3 0 52 2 0 2 18 1 52 1 0 2 52 0 0 1 17 1 16 1 33 21 0 20 4 0 18 0 1 5 0 52 2 0 2 18 1 18 2 48 3 32 42 0 18 0 52 7 0 1 1 8 0 52 6 0 2 33 21 0 20 4 0 18 0 1 8 0 52 2 0 2 18 1 18 2 48 3 32 5 0 20 9 0 48 0 17 0 20 10 0 18 3 48 1 33 51 0 51 12 0 18 4 52 11 0 2 5 20 13 0 16 0 48 1 33 10 0 20 14 0 16 0 48 1 32 6 0 16 0 52 15 0 1 19 4 5 20 16 0 18 3 16 0 49 2 32 4 0 16 0 19 5 50)} "spread?" "create-fragment" "dom-append" "dom-is-fragment?" "dom-child-nodes" "trampoline" "eval-expr" "nth" 1 "render-to-dom" 2 ">" "len" 3 "when" "r-when" {:upvalue-count 6 :arity 0 :constants ("dom-parent" "for-each" {:upvalue-count 0 :arity 1 :constants ("dom-remove") :bytecode (20 0 0 16 0 49 1 50)} "list" "trampoline" "eval-expr" "nth" 1 "create-fragment" {:upvalue-count 4 :arity 1 :constants ("dom-append" "render-to-dom" "nth") :bytecode (20 0 0 18 0 20 1 0 18 1 16 0 52 2 0 2 18 2 18 3 48 3 49 2 50)} "range" 2 "len" "dom-child-nodes" "dom-insert-after") :bytecode (20 0 0 18 0 48 1 33 101 0 51 2 0 18 1 52 1 0 2 5 52 3 0 0 19 1 5 18 2 1 7 0 52 6 0 2 18 3 52 5 0 2 52 4 0 1 33 58 0 20 8 0 48 0 17 0 51 9 0 1 0 0 2 0 3 0 4 1 11 0 18 2 52 12 0 1 52 10 0 2 52 1 0 2 5 20 13 0 16 0 48 1 19 1 5 20 14 0 18 0 16 0 49 2 32 1 0 2 32 76 0 18 2 1 7 0 52 6 0 2 18 3 52 5 0 2 52 4 0 1 33 53 0 20 8 0 48 0 17 0 51 9 0 1 0 0 2 0 3 0 4 1 11 0 18 2 52 12 0 1 52 10 0 2 52 1 0 2 5 20 13 0 16 0 48 1 19 1 5 16 0 19 5 32 1 0 2 50)} "not" "for-each" {:upvalue-count 4 :arity 1 :constants ("dom-append" "render-to-dom" "nth") :bytecode (20 0 0 18 0 20 1 0 18 1 16 0 52 2 0 2 18 2 18 3 48 3 49 2 50)} "range" "cond" "r-cond" {:upvalue-count 6 :arity 0 :constants ("eval-cond" "rest" "dom-parent" "for-each" {:upvalue-count 0 :arity 1 :constants ("dom-remove") :bytecode (20 0 0 16 0 49 1 50)} "list" "render-to-dom" "dom-is-fragment?" "dom-child-nodes" "dom-insert-after") :bytecode (20 0 0 18 0 52 1 0 1 18 1 48 2 17 0 20 2 0 18 2 48 1 33 80 0 51 4 0 18 3 52 3 0 2 5 52 5 0 0 19 3 5 16 0 33 54 0 20 6 0 16 0 18 1 18 4 48 3 17 1 20 7 0 16 1 48 1 33 10 0 20 8 0 16 1 48 1 32 6 0 16 1 52 5 0 1 19 3 5 20 9 0 18 2 16 1 49 2 32 1 0 2 32 55 0 16 0 33 49 0 20 6 0 16 0 18 1 18 4 48 3 17 1 20 7 0 16 1 48 1 33 10 0 20 8 0 16 1 48 1 32 6 0 16 1 52 5 0 1 19 3 5 16 1 19 5 32 1 0 2 50)} "eval-cond" "rest" "case" "let" "let*" "process-bindings" {:upvalue-count 4 :arity 1 :constants ("render-to-dom" "nth" "not" "spread?" "dom-append") :bytecode (20 0 0 18 0 16 0 52 1 0 2 18 1 18 2 48 3 17 1 16 1 52 3 0 1 52 2 0 1 33 12 0 20 4 0 18 3 16 1 49 2 32 1 0 2 50)} "letrec" "slice" "env-extend" {:upvalue-count 1 :arity 1 :constants ("=" "type-of" "first" "symbol" "symbol-name" "str" "env-bind!") :bytecode (16 0 52 2 0 1 52 1 0 1 1 3 0 52 0 0 2 33 13 0 16 0 52 2 0 1 52 4 0 1 32 10 0 16 0 52 2 0 1 52 5 0 1 17 1 18 0 16 1 2 52 6 0 3 50)} {:upvalue-count 1 :arity 1 :constants ("=" "type-of" "first" "symbol" "symbol-name" "str" "env-set!" "trampoline" "eval-expr" "nth" 1) :bytecode (16 0 52 2 0 1 52 1 0 1 1 3 0 52 0 0 2 33 13 0 16 0 52 2 0 1 52 4 0 1 32 10 0 16 0 52 2 0 1 52 5 0 1 17 1 18 0 16 1 16 0 1 10 0 52 9 0 2 18 0 52 8 0 2 52 7 0 1 52 6 0 3 50)} {:upvalue-count 1 :arity 1 :constants ("trampoline" "eval-expr") :bytecode (16 0 18 0 52 1 0 2 52 0 0 1 50)} "init" "last" "begin" "do" "definition-form?" "map" "type-of" "first" "symbol" "symbol-name" "deref" "signal?" "reactive-list" {:upvalue-count 4 :arity 1 :constants ("lambda?" "render-lambda-dom" "list" "render-to-dom" "apply" "dom-append") :bytecode (18 0 52 0 0 1 33 20 0 20 1 0 18 0 16 0 52 2 0 1 18 1 18 2 48 4 32 21 0 20 3 0 18 0 16 0 52 2 0 1 52 4 0 2 18 1 18 2 48 3 17 1 20 5 0 18 3 16 1 49 2 50)} "map-indexed" "for-each-indexed" {:upvalue-count 4 :arity 2 :constants ("lambda?" "render-lambda-dom" "list" "render-to-dom" "apply" "dom-append") :bytecode (18 0 52 0 0 1 33 22 0 20 1 0 18 0 16 0 16 1 52 2 0 2 18 1 18 2 48 4 32 23 0 20 3 0 18 0 16 0 16 1 52 2 0 2 52 4 0 2 18 1 18 2 48 3 17 2 20 5 0 18 3 16 2 49 2 50)} "filter" "portal" "render-dom-portal" "error-boundary" "render-dom-error-boundary" "scope" ">=" "keyword" "keyword-name" "value" "scope-push!" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)} "scope-pop!" "provide" "cyst" "key" "str" "next-cyst-id" "get" "*memo-cache*" "host-get" "isConnected" "dom-create-element" "div" "dom-set-attr" "data-sx-cyst" "with-island-scope" {:upvalue-count 1 :arity 1 :constants ("append!") :bytecode (18 0 16 0 52 0 0 2 50)} {:upvalue-count 3 :arity 0 :constants ("create-fragment" "for-each" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)}) :bytecode (20 0 0 48 0 17 0 51 2 0 1 0 0 0 0 1 18 2 52 1 0 2 5 16 0 50)} "dom-set-data" "sx-disposers" "dict-set!") :bytecode (16 0 1 1 0 52 0 0 2 33 224 0 20 2 0 48 0 33 124 0 20 3 0 1 4 0 48 1 17 4 52 5 0 0 17 5 2 17 6 20 6 0 51 7 0 1 1 1 2 1 3 1 4 1 5 1 6 48 1 5 16 6 52 8 0 1 33 5 0 16 6 32 67 0 20 9 0 48 0 17 7 20 10 0 16 7 16 4 48 2 5 16 6 33 41 0 20 11 0 16 6 48 1 33 10 0 20 12 0 16 6 48 1 32 6 0 16 6 52 5 0 1 17 5 5 20 10 0 16 7 16 6 48 2 32 1 0 2 5 16 7 32 89 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 4 16 4 33 21 0 20 17 0 16 1 1 18 0 52 15 0 2 16 2 16 3 49 3 32 42 0 16 1 52 20 0 1 1 21 0 52 19 0 2 33 21 0 20 17 0 16 1 1 21 0 52 15 0 2 16 2 16 3 49 3 32 5 0 20 9 0 49 0 32 176 7 16 0 1 22 0 52 0 0 2 33 178 0 20 2 0 48 0 33 95 0 20 3 0 1 23 0 48 1 17 4 52 5 0 0 17 5 2 17 6 20 6 0 51 24 0 1 4 1 5 1 1 1 2 1 3 1 6 48 1 5 16 6 52 8 0 1 33 5 0 16 6 32 38 0 20 9 0 48 0 17 7 20 10 0 16 7 16 4 48 2 5 16 6 33 12 0 20 10 0 16 7 16 6 48 2 32 1 0 2 5 16 7 32 72 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 52 25 0 1 33 8 0 20 9 0 49 0 32 38 0 20 9 0 48 0 17 4 51 27 0 1 4 1 1 1 2 1 3 1 18 0 16 1 52 20 0 1 52 28 0 2 52 26 0 2 5 16 4 32 242 6 16 0 1 29 0 52 0 0 2 33 145 0 20 2 0 48 0 33 95 0 20 3 0 1 30 0 48 1 17 4 52 5 0 0 17 5 2 17 6 20 6 0 51 31 0 1 1 1 2 1 4 1 5 1 3 1 6 48 1 5 16 6 52 8 0 1 33 5 0 16 6 32 38 0 20 9 0 48 0 17 7 20 10 0 16 7 16 4 48 2 5 16 6 33 12 0 20 10 0 16 7 16 6 48 2 32 1 0 2 5 16 7 32 39 0 20 32 0 16 1 52 33 0 1 16 2 48 2 17 4 16 4 33 14 0 20 17 0 16 4 16 2 16 3 49 3 32 5 0 20 9 0 49 0 32 85 6 16 0 1 34 0 52 0 0 2 33 24 0 20 17 0 16 1 16 2 52 14 0 2 52 13 0 1 16 2 16 3 49 3 32 49 6 16 0 1 35 0 52 0 0 2 6 34 10 0 5 16 0 1 36 0 52 0 0 2 33 96 0 20 37 0 16 1 1 16 0 52 15 0 2 16 2 48 2 17 4 16 1 52 20 0 1 1 21 0 52 0 0 2 33 21 0 20 17 0 16 1 1 18 0 52 15 0 2 16 4 16 3 49 3 32 38 0 20 9 0 48 0 17 5 51 38 0 1 1 1 4 1 3 1 5 1 18 0 16 1 52 20 0 1 52 28 0 2 52 26 0 2 5 16 5 32 183 5 16 0 1 39 0 52 0 0 2 33 108 0 16 1 1 16 0 52 15 0 2 17 4 16 1 1 18 0 52 40 0 2 17 5 16 2 52 41 0 1 17 6 51 42 0 1 6 16 4 52 26 0 2 5 51 43 0 1 6 16 4 52 26 0 2 5 16 5 52 20 0 1 1 16 0 52 19 0 2 33 18 0 51 44 0 1 6 16 5 52 45 0 1 52 26 0 2 32 1 0 2 5 20 17 0 16 5 52 46 0 1 16 6 16 3 49 3 32 63 5 16 0 1 47 0 52 0 0 2 6 34 10 0 5 16 0 1 48 0 52 0 0 2 33 78 0 16 1 52 20 0 1 1 18 0 52 0 0 2 33 21 0 20 17 0 16 1 1 16 0 52 15 0 2 16 2 16 3 49 3 32 38 0 20 9 0 48 0 17 4 51 38 0 1 1 1 2 1 3 1 4 1 16 0 16 1 52 20 0 1 52 28 0 2 52 26 0 2 5 16 4 32 215 4 20 49 0 16 0 48 1 33 21 0 16 1 16 2 52 14 0 2 52 13 0 1 5 20 9 0 49 0 32 184 4 16 0 1 50 0 52 0 0 2 33 22 1 16 1 1 18 0 52 15 0 2 17 4 20 2 0 48 0 6 33 76 0 5 16 4 52 51 0 1 1 5 0 52 0 0 2 6 33 58 0 5 16 4 52 20 0 1 1 16 0 52 19 0 2 6 33 40 0 5 16 4 52 52 0 1 52 51 0 1 1 53 0 52 0 0 2 6 33 18 0 5 16 4 52 52 0 1 52 54 0 1 1 55 0 52 0 0 2 33 107 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 5 16 4 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 6 20 56 0 16 6 48 1 33 16 0 20 57 0 16 5 16 6 16 2 16 3 49 4 32 36 0 20 55 0 16 6 48 1 17 7 20 9 0 48 0 17 8 51 58 0 1 5 1 2 1 3 1 8 16 7 52 26 0 2 5 16 8 32 69 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 5 16 1 1 18 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 6 20 9 0 48 0 17 7 51 58 0 1 5 1 2 1 3 1 7 16 6 52 26 0 2 5 16 7 32 150 3 16 0 1 59 0 52 0 0 2 33 72 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 4 16 1 1 18 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 5 20 9 0 48 0 17 6 51 61 0 1 4 1 2 1 3 1 6 16 5 52 60 0 2 5 16 6 32 66 3 16 0 1 62 0 52 0 0 2 33 24 0 20 17 0 16 1 16 2 52 14 0 2 52 13 0 1 16 2 16 3 49 3 32 30 3 16 0 1 63 0 52 0 0 2 33 18 0 20 64 0 16 1 52 33 0 1 16 2 16 3 49 3 32 0 3 16 0 1 65 0 52 0 0 2 33 18 0 20 66 0 16 1 52 33 0 1 16 2 16 3 49 3 32 226 2 16 0 1 26 0 52 0 0 2 33 72 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 4 16 1 1 18 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 5 20 9 0 48 0 17 6 51 58 0 1 4 1 2 1 3 1 6 16 5 52 26 0 2 5 16 6 32 142 2 16 0 1 67 0 52 0 0 2 33 183 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 4 16 1 1 18 0 52 40 0 2 17 5 2 17 6 2 17 7 20 9 0 48 0 17 8 16 5 52 20 0 1 1 18 0 52 68 0 2 6 33 40 0 5 16 5 52 52 0 1 52 51 0 1 1 69 0 52 0 0 2 6 33 18 0 5 16 5 52 52 0 1 52 70 0 1 1 71 0 52 0 0 2 33 36 0 16 5 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 6 5 16 5 1 18 0 52 40 0 2 17 7 32 4 0 16 5 17 7 5 16 4 16 6 52 72 0 2 5 51 73 0 1 8 1 2 1 3 16 7 52 26 0 2 5 16 4 52 74 0 1 5 16 8 32 203 1 16 0 1 75 0 52 0 0 2 33 99 0 16 1 1 16 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 4 16 1 1 18 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 17 5 20 9 0 48 0 17 6 16 4 16 5 52 72 0 2 5 51 27 0 1 6 1 1 1 2 1 3 1 21 0 16 1 52 20 0 1 52 28 0 2 52 26 0 2 5 16 4 52 74 0 1 5 16 6 32 92 1 16 0 1 76 0 52 0 0 2 33 59 1 16 1 52 20 0 1 1 18 0 52 19 0 2 6 33 46 0 5 16 1 1 16 0 52 15 0 2 52 51 0 1 1 69 0 52 0 0 2 6 33 21 0 5 16 1 1 16 0 52 15 0 2 52 70 0 1 1 77 0 52 0 0 2 33 26 0 16 1 1 18 0 52 15 0 2 16 2 52 14 0 2 52 13 0 1 52 78 0 1 32 5 0 20 79 0 48 0 17 4 20 81 0 16 4 52 80 0 2 17 5 16 5 6 33 11 0 5 20 82 0 16 5 1 83 0 48 2 33 5 0 16 5 32 177 0 20 84 0 1 85 0 2 48 2 17 6 52 5 0 0 17 7 16 1 52 20 0 1 1 18 0 52 19 0 2 6 33 46 0 5 16 1 1 16 0 52 15 0 2 52 51 0 1 1 69 0 52 0 0 2 6 33 21 0 5 16 1 1 16 0 52 15 0 2 52 70 0 1 1 77 0 52 0 0 2 33 12 0 16 1 1 21 0 52 40 0 2 32 9 0 16 1 1 16 0 52 40 0 2 17 8 20 86 0 16 6 1 87 0 16 4 48 3 5 20 88 0 51 89 0 1 7 51 90 0 1 2 1 3 1 8 48 2 17 9 20 10 0 16 6 16 9 48 2 5 20 91 0 16 6 1 92 0 16 7 48 3 5 20 81 0 16 4 16 6 52 93 0 3 5 16 6 32 21 0 20 17 0 16 1 16 2 52 14 0 2 52 13 0 1 16 2 16 3 49 3 50)} "render-lambda-dom" {:upvalue-count 0 :arity 4 :constants ("env-merge" "lambda-closure" "for-each-indexed" {:upvalue-count 2 :arity 2 :constants ("env-bind!" "nth") :bytecode (18 0 16 1 18 1 16 0 52 1 0 2 52 0 0 3 50)} "lambda-params" "render-to-dom" "lambda-body") :bytecode (16 0 52 1 0 1 16 2 52 0 0 2 17 4 51 3 0 1 4 1 1 16 0 52 4 0 1 52 2 0 2 5 20 5 0 16 0 52 6 0 1 16 4 16 3 49 3 50)} "render-dom-island" {:upvalue-count 0 :arity 4 :constants ("dict" "list" "reduce" {:upvalue-count 4 :arity 2 :constants ("get" "skip" "assoc" "i" "inc" "=" "type-of" "keyword" "<" "len" "trampoline" "eval-expr" "nth" "dict-set!" "keyword-name" "append!") :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 2 33 29 0 16 0 1 1 0 4 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 150 0 16 1 52 6 0 1 1 7 0 52 5 0 2 6 33 24 0 5 16 0 1 3 0 52 0 0 2 52 4 0 1 18 0 52 9 0 1 52 8 0 2 33 75 0 18 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 12 0 2 18 1 52 11 0 2 52 10 0 1 17 3 18 2 16 1 52 14 0 1 16 3 52 13 0 3 5 16 0 1 1 0 3 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 31 0 18 3 16 1 52 15 0 2 5 16 0 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 3 50)} "i" 0 "skip" "env-merge" "component-closure" "component-name" "for-each" {:upvalue-count 2 :arity 1 :constants ("env-bind!" "dict-has?" "dict-get") :bytecode (18 0 16 0 18 1 16 0 52 1 0 2 33 11 0 18 1 16 0 52 2 0 2 32 1 0 2 52 0 0 3 50)} "component-params" "component-has-children?" "create-fragment" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)} "env-bind!" "children" "dom-create-element" "span" "dom-set-attr" "data-sx-island" "not" "empty-dict?" "data-sx-state" "sx-serialize" "mark-processed!" "island-hydrated" "with-island-scope" {:upvalue-count 1 :arity 1 :constants ("append!") :bytecode (18 0 16 0 52 0 0 2 50)} {:upvalue-count 3 :arity 0 :constants ("render-to-dom" "component-body") :bytecode (20 0 0 18 0 52 1 0 1 18 1 18 2 49 3 50)} "dom-append" "dom-set-data" "sx-disposers") :bytecode (52 0 0 0 17 4 52 1 0 0 17 5 51 3 0 1 1 1 2 1 4 1 5 1 4 0 1 5 0 1 6 0 4 52 0 0 4 16 1 52 2 0 3 5 16 0 52 8 0 1 16 2 52 7 0 2 17 6 16 0 52 9 0 1 17 7 51 11 0 1 6 1 4 16 0 52 12 0 1 52 10 0 2 5 16 0 52 13 0 1 33 37 0 20 14 0 48 0 17 8 51 15 0 1 8 1 2 1 3 16 5 52 10 0 2 5 16 6 1 17 0 16 8 52 16 0 3 32 1 0 2 5 20 18 0 1 19 0 2 48 2 17 8 52 1 0 0 17 9 20 20 0 16 8 1 21 0 16 7 48 3 5 16 4 52 23 0 1 52 22 0 1 33 19 0 20 20 0 16 8 1 24 0 16 4 52 25 0 1 48 3 32 1 0 2 5 20 26 0 16 8 1 27 0 48 2 5 20 28 0 51 29 0 1 9 51 30 0 1 0 1 6 1 3 48 2 17 10 20 31 0 16 8 16 10 48 2 5 20 32 0 16 8 1 33 0 16 9 48 3 5 16 8 50)} "render-dom-lake" {:upvalue-count 0 :arity 3 :constants ("div" "list" "reduce" {:upvalue-count 5 :arity 2 :constants ("get" "skip" "assoc" "i" "inc" "=" "type-of" "keyword" "<" "len" "keyword-name" "trampoline" "eval-expr" "nth" "id" "tag" "append!") :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 2 33 29 0 16 0 1 1 0 4 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 183 0 16 1 52 6 0 1 1 7 0 52 5 0 2 6 33 24 0 5 16 0 1 3 0 52 0 0 2 52 4 0 1 18 0 52 9 0 1 52 8 0 2 33 108 0 16 1 52 10 0 1 17 3 18 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 13 0 2 18 1 52 12 0 2 52 11 0 1 17 4 16 3 1 14 0 52 5 0 2 33 7 0 16 4 19 2 32 20 0 16 3 1 15 0 52 5 0 2 33 7 0 16 4 19 3 32 1 0 2 5 16 0 1 1 0 3 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 31 0 18 4 16 1 52 16 0 2 5 16 0 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 3 50)} "dict" "i" 0 "skip" "dom-create-element" "dom-set-attr" "data-sx-lake" "" "for-each" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)}) :bytecode (2 17 3 1 0 0 17 4 52 1 0 0 17 5 51 3 0 1 0 1 1 1 3 1 4 1 5 1 5 0 1 6 0 1 7 0 4 52 4 0 4 16 0 52 2 0 3 5 20 8 0 16 4 2 48 2 17 6 20 9 0 16 6 1 10 0 16 3 6 34 4 0 5 1 11 0 48 3 5 51 13 0 1 6 1 1 1 2 16 5 52 12 0 2 5 16 6 50)} "render-dom-marsh" {:upvalue-count 0 :arity 3 :constants ("div" "list" "reduce" {:upvalue-count 6 :arity 2 :constants ("get" "skip" "assoc" "i" "inc" "=" "type-of" "keyword" "<" "len" "keyword-name" "trampoline" "eval-expr" "nth" "id" "tag" "transform" "append!") :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 2 33 29 0 16 0 1 1 0 4 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 202 0 16 1 52 6 0 1 1 7 0 52 5 0 2 6 33 24 0 5 16 0 1 3 0 52 0 0 2 52 4 0 1 18 0 52 9 0 1 52 8 0 2 33 127 0 16 1 52 10 0 1 17 3 18 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 13 0 2 18 1 52 12 0 2 52 11 0 1 17 4 16 3 1 14 0 52 5 0 2 33 7 0 16 4 19 2 32 39 0 16 3 1 15 0 52 5 0 2 33 7 0 16 4 19 3 32 20 0 16 3 1 16 0 52 5 0 2 33 7 0 16 4 19 4 32 1 0 2 5 16 0 1 1 0 3 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 5 32 31 0 18 5 16 1 52 17 0 2 5 16 0 1 3 0 16 0 1 3 0 52 0 0 2 52 4 0 1 52 2 0 3 50)} "dict" "i" 0 "skip" "dom-create-element" "dom-set-attr" "data-sx-marsh" "" "dom-set-data" "sx-marsh-transform" "sx-marsh-env" "for-each" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)}) :bytecode (2 17 3 1 0 0 17 4 2 17 5 52 1 0 0 17 6 51 3 0 1 0 1 1 1 3 1 4 1 5 1 6 1 5 0 1 6 0 1 7 0 4 52 4 0 4 16 0 52 2 0 3 5 20 8 0 16 4 2 48 2 17 7 20 9 0 16 7 1 10 0 16 3 6 34 4 0 5 1 11 0 48 3 5 16 5 33 15 0 20 12 0 16 7 1 13 0 16 5 48 3 32 1 0 2 5 20 12 0 16 7 1 14 0 16 1 48 3 5 51 16 0 1 7 1 1 1 2 16 6 52 15 0 2 5 16 7 50)} "reactive-text" {:upvalue-count 0 :arity 1 :constants ("create-text-node" "str" "deref" "effect" {:upvalue-count 2 :arity 0 :constants ("dom-set-text-content" "str" "deref") :bytecode (20 0 0 18 0 20 2 0 18 1 48 1 52 1 0 1 49 2 50)}) :bytecode (20 0 0 20 2 0 16 0 48 1 52 1 0 1 48 1 17 1 20 3 0 51 4 0 1 1 1 0 48 1 5 16 1 50)} "reactive-attr" {:upvalue-count 0 :arity 3 :constants ("dom-get-attr" "data-sx-reactive-attrs" "" "empty?" "str" "," "dom-set-attr" "effect" {:upvalue-count 3 :arity 0 :constants ("signal?" "deref" "nil?" "=" "dom-remove-attr" "dom-set-attr" "" "str") :bytecode (18 0 48 0 17 0 20 0 0 16 0 48 1 33 10 0 20 1 0 16 0 48 1 32 2 0 16 0 17 1 16 1 52 2 0 1 6 34 8 0 5 16 1 4 52 3 0 2 33 12 0 20 4 0 18 1 18 2 49 2 32 40 0 16 1 3 52 3 0 2 33 15 0 20 5 0 18 1 18 2 1 6 0 49 3 32 15 0 20 5 0 18 1 18 2 16 1 52 7 0 1 49 3 50)}) :bytecode (20 0 0 16 0 1 1 0 48 2 6 34 4 0 5 1 2 0 17 3 16 3 52 3 0 1 33 5 0 16 1 32 11 0 16 3 1 5 0 16 1 52 4 0 3 17 4 20 6 0 16 0 1 1 0 16 4 48 3 5 20 7 0 51 8 0 1 2 1 0 1 1 49 1 50)} "reactive-spread" {:upvalue-count 0 :arity 2 :constants ("list" "dom-get-attr" "data-sx-reactive-attrs" "" "dom-set-attr" "empty?" "_spread" "str" ",_spread" "effect" {:upvalue-count 4 :arity 0 :constants ("not" "empty?" "dom-get-attr" "class" "" "filter" {:upvalue-count 0 :arity 1 :constants ("not" "=" "") :bytecode (16 0 1 2 0 52 1 0 2 52 0 0 1 50)} "split" " " {:upvalue-count 1 :arity 1 :constants ("not" "some" {:upvalue-count 1 :arity 1 :constants ("=") :bytecode (16 0 18 0 52 0 0 2 50)}) :bytecode (51 2 0 1 0 18 0 52 1 0 2 52 0 0 1 50)} "dom-remove-attr" "dom-set-attr" "join" "for-each" {:upvalue-count 1 :arity 1 :constants ("dom-remove-attr") :bytecode (20 0 0 18 0 16 0 49 2 50)} "spread?" "spread-attrs" "dict-get" {:upvalue-count 0 :arity 1 :constants ("not" "=" "class") :bytecode (16 0 1 2 0 52 1 0 2 52 0 0 1 50)} "keys" "=" "str" {:upvalue-count 2 :arity 1 :constants ("dom-set-attr" "str" "dict-get") :bytecode (20 0 0 18 0 16 0 18 1 16 0 52 2 0 2 52 1 0 1 49 3 50)} "run-post-render-hooks" "list") :bytecode (18 0 52 1 0 1 52 0 0 1 33 95 0 20 2 0 18 1 1 3 0 48 2 6 34 4 0 5 1 4 0 17 0 51 6 0 16 0 1 8 0 52 7 0 2 52 5 0 2 17 1 51 9 0 0 0 16 1 52 5 0 2 17 2 16 2 52 1 0 1 33 13 0 20 10 0 18 1 1 3 0 48 2 32 19 0 20 11 0 18 1 1 3 0 1 8 0 16 2 52 12 0 2 48 3 32 1 0 2 5 51 14 0 0 1 18 2 52 13 0 2 5 18 3 48 0 17 0 16 0 52 15 0 1 33 179 0 16 0 52 16 0 1 17 1 16 1 1 3 0 52 17 0 2 6 34 4 0 5 1 4 0 17 2 51 6 0 16 2 1 8 0 52 7 0 2 52 5 0 2 17 3 51 18 0 16 1 52 19 0 1 52 5 0 2 17 4 16 3 19 0 5 16 4 19 2 5 16 3 52 1 0 1 52 0 0 1 33 72 0 20 2 0 18 1 1 3 0 48 2 6 34 4 0 5 1 4 0 17 5 20 11 0 18 1 1 3 0 16 5 6 33 14 0 5 16 5 1 4 0 52 20 0 2 52 0 0 1 33 14 0 16 5 1 8 0 16 2 52 21 0 3 32 2 0 16 2 48 3 32 1 0 2 5 51 22 0 0 1 1 1 16 4 52 13 0 2 5 20 23 0 49 0 32 13 0 52 24 0 0 19 0 5 52 24 0 0 19 2 50)}) :bytecode (52 0 0 0 17 2 52 0 0 0 17 3 20 1 0 16 0 1 2 0 48 2 6 34 4 0 5 1 3 0 17 4 20 4 0 16 0 1 2 0 16 4 52 5 0 1 33 6 0 1 6 0 32 9 0 16 4 1 8 0 52 7 0 2 48 3 5 20 9 0 51 10 0 1 2 1 0 1 3 1 1 49 1 50)} "reactive-fragment" {:upvalue-count 0 :arity 4 :constants ("create-comment" "island-fragment" "list" "effect" {:upvalue-count 4 :arity 0 :constants ("for-each" {:upvalue-count 0 :arity 1 :constants ("dom-remove") :bytecode (20 0 0 16 0 49 1 50)} "list" "dom-child-nodes" "dom-insert-after") :bytecode (51 1 0 18 0 52 0 0 2 5 52 2 0 0 19 0 5 18 1 48 0 33 28 0 18 2 48 0 17 0 20 3 0 16 0 48 1 19 0 5 20 4 0 18 3 16 0 49 2 32 1 0 2 50)}) :bytecode (20 0 0 1 1 0 48 1 17 4 52 2 0 0 17 5 20 3 0 51 4 0 1 5 1 0 1 1 1 4 48 1 5 16 4 50)} "render-list-item" {:upvalue-count 0 :arity 4 :constants ("lambda?" "render-lambda-dom" "list" "render-to-dom" "apply") :bytecode (16 0 52 0 0 1 33 20 0 20 1 0 16 0 16 1 52 2 0 1 16 2 16 3 49 4 32 21 0 20 3 0 16 0 16 1 52 2 0 1 52 4 0 2 16 2 16 3 49 3 50)} "extract-key" {:upvalue-count 0 :arity 2 :constants ("dom-get-attr" "key" "dom-remove-attr" "dom-get-data" "str" "__idx_") :bytecode (20 0 0 16 0 1 1 0 48 2 17 2 16 2 33 16 0 20 2 0 16 0 1 1 0 48 2 5 16 2 32 35 0 20 3 0 16 0 1 1 0 48 2 17 3 16 3 33 9 0 16 3 52 4 0 1 32 9 0 1 5 0 16 1 52 4 0 2 50)} "reactive-list" {:upvalue-count 0 :arity 4 :constants ("create-fragment" "create-comment" "island-list" "dict" "list" "dom-append" "effect" {:upvalue-count 8 :arity 0 :constants ("deref" "dom-parent" "dict" "list" "for-each-indexed" {:upvalue-count 7 :arity 2 :constants ("render-list-item" "extract-key" "not" "starts-with?" "__idx_" "dict-has?" "dict-set!" "dict-get" "append!") :bytecode (20 0 0 18 0 16 1 18 1 18 2 48 4 17 2 20 1 0 16 2 16 0 48 2 17 3 18 3 52 2 0 1 6 33 14 0 5 16 3 1 4 0 52 3 0 2 52 2 0 1 33 6 0 3 19 3 32 1 0 2 5 18 4 16 3 52 5 0 2 33 19 0 18 5 16 3 18 4 16 3 52 7 0 2 52 6 0 3 32 10 0 18 5 16 3 16 2 52 6 0 3 5 18 6 16 3 52 8 0 2 50)} "not" "dom-remove-children-after" "create-fragment" "for-each" {:upvalue-count 2 :arity 1 :constants ("dom-append" "dict-get") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 2 49 2 50)} "dom-insert-after" {:upvalue-count 2 :arity 1 :constants ("not" "dict-has?" "dom-remove" "dict-get") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 16 0 20 2 0 18 1 16 0 52 3 0 2 49 1 32 1 0 2 50)} {:upvalue-count 2 :arity 1 :constants ("dict-get" "dom-next-sibling" "not" "identical?" "dom-insert-after") :bytecode (18 0 16 0 52 0 0 2 17 1 20 1 0 18 1 48 1 17 2 16 1 16 2 52 3 0 2 52 2 0 1 33 12 0 20 4 0 18 1 16 1 48 2 32 1 0 2 5 16 1 19 1 50)} {:upvalue-count 6 :arity 2 :constants ("render-list-item" "extract-key" "dict-set!" "append!" "dom-append") :bytecode (20 0 0 18 0 16 1 18 1 18 2 48 4 17 2 20 1 0 16 2 16 0 48 2 17 3 18 3 16 3 16 2 52 2 0 3 5 18 4 16 3 52 3 0 2 5 20 4 0 18 5 16 2 49 2 50)}) :bytecode (20 0 0 18 0 48 1 17 0 20 1 0 18 1 48 1 33 133 0 52 2 0 0 17 1 52 3 0 0 17 2 4 17 3 51 5 0 0 2 0 3 0 4 1 3 0 5 1 1 1 2 16 0 52 4 0 2 5 16 3 52 6 0 1 33 41 0 20 7 0 18 1 48 1 5 20 8 0 48 0 17 4 51 10 0 1 4 1 1 16 2 52 9 0 2 5 20 11 0 18 1 16 4 48 2 32 31 0 51 12 0 1 1 0 5 18 6 52 9 0 2 5 18 1 17 4 51 13 0 1 1 1 4 16 2 52 9 0 2 5 16 1 19 5 5 16 2 19 6 32 21 0 51 14 0 0 2 0 3 0 4 0 5 0 6 0 7 16 0 52 4 0 2 50)}) :bytecode (20 0 0 48 0 17 4 20 1 0 1 2 0 48 1 17 5 52 3 0 0 17 6 52 4 0 0 17 7 20 5 0 16 4 16 5 48 2 5 20 6 0 51 7 0 1 1 1 5 1 0 1 2 1 3 1 6 1 7 1 4 48 1 5 16 4 50)} "bind-input" {:upvalue-count 0 :arity 2 :constants ("lower" "dom-get-attr" "type" "" "=" "checkbox" "radio" "dom-set-prop" "checked" "deref" "value" "str" "effect" {:upvalue-count 3 :arity 0 :constants ("dom-set-prop" "checked" "deref" "str" "!=" "dom-get-prop" "value") :bytecode (18 0 33 20 0 20 0 0 18 1 1 1 0 20 2 0 18 2 48 1 49 3 32 48 0 20 2 0 18 2 48 1 52 3 0 1 17 0 20 5 0 18 1 1 6 0 48 2 16 0 52 4 0 2 33 15 0 20 0 0 18 1 1 6 0 16 0 49 3 32 1 0 2 50)} "dom-on" "change" "input" {:upvalue-count 3 :arity 1 :constants ("reset!" "dom-get-prop" "checked" "value") :bytecode (18 0 33 20 0 20 0 0 18 1 20 1 0 18 2 1 2 0 48 2 49 2 32 17 0 20 0 0 18 1 20 1 0 18 2 1 3 0 48 2 49 2 50)}) :bytecode (20 1 0 16 0 1 2 0 48 2 6 34 4 0 5 1 3 0 52 0 0 1 17 2 16 2 1 5 0 52 4 0 2 6 34 10 0 5 16 2 1 6 0 52 4 0 2 17 3 16 3 33 20 0 20 7 0 16 0 1 8 0 20 9 0 16 1 48 1 48 3 32 21 0 20 7 0 16 0 1 10 0 20 9 0 16 1 48 1 52 11 0 1 48 3 5 20 12 0 51 13 0 1 3 1 0 1 1 48 1 5 20 14 0 16 0 16 3 33 6 0 1 15 0 32 3 0 1 16 0 51 17 0 1 3 1 1 1 0 49 3 50)} "*use-cek-reactive*" "enable-cek-reactive!" {:upvalue-count 0 :arity 0 :constants ("*use-cek-reactive*") :bytecode (3 21 0 0 50)} "cek-reactive-text" {:upvalue-count 0 :arity 2 :constants ("create-text-node" "" {:upvalue-count 1 :arity 1 :constants ("dom-set-text-content" "str") :bytecode (20 0 0 18 0 16 0 52 1 0 1 49 2 50)} "cek-run" "make-cek-state" "list" "make-reactive-reset-frame" "dom-set-text-content" "str") :bytecode (20 0 0 1 1 0 48 1 17 2 51 2 0 1 2 17 3 20 3 0 20 4 0 16 0 16 1 20 6 0 16 1 16 3 3 48 3 52 5 0 1 48 3 48 1 17 4 20 7 0 16 2 16 4 52 8 0 1 48 2 5 16 2 50)} "cek-reactive-attr" {:upvalue-count 0 :arity 4 :constants ({:upvalue-count 2 :arity 1 :constants ("nil?" "=" "dom-remove-attr" "dom-set-attr" "" "str") :bytecode (16 0 52 0 0 1 6 34 8 0 5 16 0 4 52 1 0 2 33 12 0 20 2 0 18 0 18 1 49 2 32 40 0 16 0 3 52 1 0 2 33 15 0 20 3 0 18 0 18 1 1 4 0 49 3 32 15 0 20 3 0 18 0 18 1 16 0 52 5 0 1 49 3 50)} "dom-get-attr" "data-sx-reactive-attrs" "" "empty?" "str" "," "dom-set-attr" "cek-run" "make-cek-state" "list" "make-reactive-reset-frame" "cek-call") :bytecode (51 0 0 1 0 1 1 17 4 20 1 0 16 0 1 2 0 48 2 6 34 4 0 5 1 3 0 17 5 16 5 52 4 0 1 33 5 0 16 1 32 11 0 16 5 1 6 0 16 1 52 5 0 3 17 6 20 7 0 16 0 1 2 0 16 6 48 3 5 20 8 0 20 9 0 16 2 16 3 20 11 0 16 3 16 4 3 48 3 52 10 0 1 48 3 48 1 17 5 16 4 16 5 52 10 0 1 52 12 0 2 50)} "render-dom-portal" {:upvalue-count 0 :arity 3 :constants ("trampoline" "eval-expr" "first" "dom-query" "dom-ensure-element" "not" "create-comment" "str" "portal: " " (not found)" "create-fragment" "for-each" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)} "rest" "dom-child-nodes" "dom-append" "register-in-scope" {:upvalue-count 1 :arity 0 :constants ("for-each" {:upvalue-count 0 :arity 1 :constants ("dom-remove") :bytecode (20 0 0 16 0 49 1 50)}) :bytecode (51 1 0 18 0 52 0 0 2 50)}) :bytecode (16 0 52 2 0 1 16 1 52 1 0 2 52 0 0 1 17 3 20 3 0 16 3 48 1 6 34 8 0 5 20 4 0 16 3 48 1 17 4 16 4 52 5 0 1 33 20 0 20 6 0 1 8 0 16 3 1 9 0 52 7 0 3 49 1 32 75 0 20 6 0 1 8 0 16 3 52 7 0 2 48 1 17 5 20 10 0 48 0 17 6 51 12 0 1 6 1 1 1 2 16 0 52 13 0 1 52 11 0 2 5 20 14 0 16 6 48 1 17 7 20 15 0 16 4 16 6 48 2 5 20 16 0 51 17 0 1 7 48 1 5 16 5 50)} "render-dom-error-boundary" {:upvalue-count 0 :arity 3 :constants (">" "len" 1 "first" "rest" "dom-create-element" "div" "signal" 0 "dom-set-attr" "data-sx-boundary" "true" "effect" {:upvalue-count 6 :arity 0 :constants ("deref" "dom-set-prop" "innerHTML" "" "scope-push!" "sx-island-scope" "try-catch" {:upvalue-count 4 :arity 0 :constants ("create-fragment" "for-each" {:upvalue-count 3 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 18 2 48 3 49 2 50)} "dom-append" "scope-pop!" "sx-island-scope") :bytecode (20 0 0 48 0 17 0 51 2 0 1 0 0 0 0 1 18 2 52 1 0 2 5 20 3 0 18 3 16 0 48 2 5 1 5 0 52 4 0 1 50)} {:upvalue-count 5 :arity 1 :constants ("scope-pop!" "sx-island-scope" "trampoline" "eval-expr" {:upvalue-count 1 :arity 0 :constants ("swap!" {:upvalue-count 0 :arity 1 :constants ("+" 1) :bytecode (16 0 1 1 0 52 0 0 2 50)}) :bytecode (20 0 0 18 0 51 1 0 49 2 50)} "nil?" "dom-create-element" "div" "dom-set-attr" "class" "sx-render-error" "style" "color:red;font-size:0.875rem;padding:0.5rem;border:1px solid red;border-radius:0.25rem;margin:0.5rem 0;" "dom-set-text-content" "str" "Render error: " "lambda?" "render-lambda-dom" "list" "render-to-dom" "apply" "dom-append") :bytecode (1 1 0 52 0 0 1 5 18 0 18 1 52 3 0 2 52 2 0 1 17 1 51 4 0 0 2 17 2 16 1 52 5 0 1 33 61 0 20 6 0 1 7 0 2 48 2 17 4 20 8 0 16 4 1 9 0 1 10 0 48 3 5 20 8 0 16 4 1 11 0 1 12 0 48 3 5 20 13 0 16 4 1 15 0 16 0 52 14 0 2 48 2 5 16 4 32 54 0 16 1 52 16 0 1 33 22 0 20 17 0 16 1 16 0 16 2 52 18 0 2 18 1 18 3 48 4 32 23 0 20 19 0 16 1 16 0 16 2 52 18 0 2 52 20 0 2 18 1 18 3 48 3 17 3 20 21 0 18 4 16 3 49 2 50)}) :bytecode (20 0 0 18 0 48 1 5 20 1 0 18 1 1 2 0 1 3 0 48 3 5 1 5 0 2 52 4 0 2 5 51 7 0 0 2 0 3 0 4 0 1 51 8 0 0 5 0 2 0 0 0 3 0 1 52 6 0 2 50)}) :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 9 0 16 0 52 3 0 1 32 1 0 2 17 3 16 0 52 1 0 1 1 2 0 52 0 0 2 33 9 0 16 0 52 4 0 1 32 2 0 16 0 17 4 20 5 0 1 6 0 2 48 2 17 5 20 7 0 1 8 0 48 1 17 6 20 9 0 16 5 1 10 0 1 11 0 48 3 5 20 12 0 51 13 0 1 6 1 5 1 1 1 2 1 4 1 3 48 1 5 16 5 50)} {:library (web adapter-dom) :op "import"}) :bytecode (1 0 0 112 5 1 1 0 112 5 1 3 0 128 2 0 5 1 5 0 128 4 0 5 51 7 0 128 6 0 5 52 9 0 0 128 8 0 5 1 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 1 34 0 1 35 0 1 36 0 1 37 0 1 38 0 1 39 0 1 40 0 1 41 0 1 42 0 1 43 0 1 44 0 1 45 0 1 46 0 1 47 0 1 48 0 1 49 0 1 50 0 1 51 0 1 52 0 1 53 0 1 54 0 1 55 0 1 56 0 52 33 0 23 128 32 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 3 128 85 0 5 51 87 0 128 86 0 5 51 89 0 128 88 0 5 51 91 0 128 90 0 5 51 93 0 128 92 0 5 51 95 0 128 94 0 5 1 96 0 112 50))) diff --git a/shared/static/wasm/sx/adapter-html.sxbc b/shared/static/wasm/sx/adapter-html.sxbc index c254e422..2d878979 100644 --- a/shared/static/wasm/sx/adapter-html.sxbc +++ b/shared/static/wasm/sx/adapter-html.sxbc @@ -1,3 +1,3 @@ (sxbc 1 "f9327868ed83a255" (code - :constants ("render-to-html" {:upvalue-count 0 :arity 2 :constants ("set-render-active!" "type-of" "nil" "=" "" "string" "escape-html" "number" "str" "boolean" "true" "false" "list" "empty?" "render-list-to-html" "symbol" "render-value-to-html" "trampoline" "eval-expr" "keyword" "keyword-name" "raw-html" "raw-html-content" "spread" "scope-emit!" "element-attrs" "spread-attrs" "thunk" "render-to-html" "thunk-expr" "thunk-env") :bytecode (3 52 0 0 1 5 16 0 52 1 0 1 6 1 2 0 52 3 0 2 33 7 0 5 1 4 0 32 20 1 6 1 5 0 52 3 0 2 33 11 0 5 20 6 0 16 0 49 1 32 254 0 6 1 7 0 52 3 0 2 33 10 0 5 16 0 52 8 0 1 32 233 0 6 1 9 0 52 3 0 2 33 18 0 5 16 0 33 6 0 1 10 0 32 3 0 1 11 0 32 204 0 6 1 12 0 52 3 0 2 33 28 0 5 16 0 52 13 0 1 33 6 0 1 4 0 32 9 0 20 14 0 16 0 16 1 49 2 32 165 0 6 1 15 0 52 3 0 2 33 23 0 5 20 16 0 16 0 16 1 52 18 0 2 52 17 0 1 16 1 49 2 32 131 0 6 1 19 0 52 3 0 2 33 15 0 5 20 6 0 16 0 52 20 0 1 49 1 32 105 0 6 1 21 0 52 3 0 2 33 10 0 5 16 0 52 22 0 1 32 84 0 6 1 23 0 52 3 0 2 33 21 0 5 1 25 0 16 0 52 26 0 1 52 24 0 2 5 1 4 0 32 52 0 6 1 27 0 52 3 0 2 33 21 0 5 20 28 0 16 0 52 29 0 1 16 0 52 30 0 1 49 2 32 20 0 5 20 16 0 16 0 16 1 52 18 0 2 52 17 0 1 16 1 49 2 50)} "render-value-to-html" {:upvalue-count 0 :arity 2 :constants ("type-of" "nil" "=" "" "string" "escape-html" "number" "str" "boolean" "true" "false" "list" "render-list-to-html" "raw-html" "raw-html-content" "spread" "scope-emit!" "element-attrs" "spread-attrs" "thunk" "render-to-html" "thunk-expr" "thunk-env") :bytecode (16 0 52 0 0 1 6 1 1 0 52 2 0 2 33 7 0 5 1 3 0 32 193 0 6 1 4 0 52 2 0 2 33 11 0 5 20 5 0 16 0 49 1 32 171 0 6 1 6 0 52 2 0 2 33 10 0 5 16 0 52 7 0 1 32 150 0 6 1 8 0 52 2 0 2 33 18 0 5 16 0 33 6 0 1 9 0 32 3 0 1 10 0 32 121 0 6 1 11 0 52 2 0 2 33 13 0 5 20 12 0 16 0 16 1 49 2 32 97 0 6 1 13 0 52 2 0 2 33 10 0 5 16 0 52 14 0 1 32 76 0 6 1 15 0 52 2 0 2 33 21 0 5 1 17 0 16 0 52 18 0 1 52 16 0 2 5 1 3 0 32 44 0 6 1 19 0 52 2 0 2 33 21 0 5 20 20 0 16 0 52 21 0 1 16 0 52 22 0 1 49 2 32 12 0 5 20 5 0 16 0 52 7 0 1 49 1 50)} "RENDER_HTML_FORMS" "list" "if" "when" "cond" "case" "let" "let*" "letrec" "begin" "do" "define" "defcomp" "defisland" "defmacro" "defstyle" "deftype" "defeffect" "map" "map-indexed" "filter" "for-each" "scope" "provide" "render-html-form?" {:upvalue-count 0 :arity 1 :constants ("contains?" "RENDER_HTML_FORMS") :bytecode (20 1 0 16 0 52 0 0 2 50)} "render-list-to-html" {:upvalue-count 0 :arity 2 :constants ("empty?" "" "first" "not" "=" "type-of" "symbol" "join" "map" {:upvalue-count 1 :arity 1 :constants ("render-value-to-html") :bytecode (20 0 0 16 0 18 0 49 2 50)} "symbol-name" "rest" "<>" {:upvalue-count 1 :arity 1 :constants ("render-to-html") :bytecode (20 0 0 16 0 18 0 49 2 50)} "raw!" {:upvalue-count 1 :arity 1 :constants ("str" "trampoline" "eval-expr") :bytecode (16 0 18 0 52 2 0 2 52 1 0 1 52 0 0 1 50)} "lake" "render-html-lake" "marsh" "render-html-marsh" "error-boundary" ">" "len" 1 "str" "