Fix core-signals bytecode: letrec for self-ref, explicit get for dict destructuring

Two issues prevented core-signals.sx from working as bytecode:

1. computed/effect used (let) for self-referencing bindings (recompute,
   run-effect). Changed to (letrec) so the VM pre-allocates slots before
   compiling the lambda bodies — required for self-reference in bytecode.

2. deref used dict destructuring (let {:notify n :deps d} ctx ...) which
   the transpiled OCaml compiler doesn't support. Rewrote to explicit
   (get ctx "notify") / (get ctx "deps") calls.

Also fixed compile-let dict destructuring opcodes (OP_CONST=1 not 2,
OP_CALL_PRIM=52 not 10) for future use when compiler is retranspiled.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-11 12:38:07 +00:00
parent ef8f8b7c03
commit fc9c90b7b1
6 changed files with 16 additions and 22 deletions

File diff suppressed because one or more lines are too long