Bootstrap SX bytecode compiler to native OCaml
Transpile lib/compiler.sx → hosts/ocaml/lib/sx_compiler.ml (42 functions). The bytecode compiler now runs as native OCaml instead of interpreted SX, eliminating the 24s JIT warm-up for compiler functions. - bootstrap_compiler.py: transpiler script (like bootstrap.py for evaluator) - sx_compiler.ml: 39KB native compiler (compile, compile-module, etc.) - Bind compile/compile-module as native functions in setup_core_operations - Add mutable_list to sx_runtime.ml (used by compiler pool) - Add native parse function (wraps Sx_parser.parse_all) - compile-match delegated via ref (uses letrec, transpiler can't handle) - Compile all 23 bytecode modules successfully (was 0/23 due to WASM overflow) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -455,3 +455,6 @@ let strip_prefix s prefix =
|
||||
(* debug_log — no-op in production, used by CEK evaluator for component warnings *)
|
||||
let debug_log _ _ = Nil
|
||||
|
||||
(* mutable_list — mutable list for bytecode compiler pool entries *)
|
||||
let mutable_list () = ListRef (ref [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user