OCaml bootstrapper: transpiler compiles full CEK evaluator (61/61 tests)

SX-to-OCaml transpiler (transpiler.sx) generates sx_ref.ml (~90KB, ~135
mutually recursive functions) from the spec evaluator. Foundation tests
all pass: parser, primitives, env operations, type system.

Key design decisions:
- Env variant added to value type for CEK state dict storage
- Continuation carries optional data dict for captured frames
- Dynamic var tracking distinguishes OCaml fn calls from SX value dispatch
- Single let rec...and block for forward references between all defines
- Unused ref pre-declarations eliminated via let-bound name detection

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 20:51:59 +00:00
parent 3a268e7277
commit 818e5d53f0
11 changed files with 3533 additions and 0 deletions

2
hosts/ocaml/dune-project Normal file
View File

@@ -0,0 +1,2 @@
(lang dune 3.0)
(name sx)