Files
rose-ash/spec
giles c8533181ab SX bytecode compiler working: all core expressions compile correctly
Fixed compiler.sx: hex literals → decimal (Python parser compat),
variadic subtraction → nested binary ops.

Verified compilation of:
  (+ 1 2)           → CONST 1; CONST 2; CALL_PRIM "+" 2; RETURN
  (if (> x 0) ...)  → JMP_FALSE with correct offset patching
  (let ((x 1)) ...) → LOCAL_SET/GET with slot indices (no hash)
  (define f (fn))    → CLOSURE with nested bytecode + pool

The compiler resolves all variable references at compile time:
  - let bindings → LOCAL_GET/SET with numeric slot
  - fn params → LOCAL_GET with numeric slot
  - globals/primitives → GLOBAL_GET / CALL_PRIM
  - tail calls → TAIL_CALL (not yet wired to VM)

Next: wire compiled code into OCaml VM and benchmark vs CEK.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 18:43:30 +00:00
..