Step 5.5 phase 4 (partial): add OP_PERFORM to vm.sx spec

Adds opcode 112 (OP_PERFORM / IO suspension) to lib/vm.sx's vm-step
dispatch. The native sx_vm.ml already has this opcode — this brings
the SX spec into alignment.

Full VM transpilation deferred to Step 6 (define-record-type): the
dict-based state in vm.sx maps to get_val/sx_dict_set_b calls which
are ~5x slower than native record/array access in the hot loop.
define-record-type will let vm.sx use typed records that the
transpiler maps to OCaml records natively.

2598/2598 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 20:29:27 +00:00
parent 9257b6a2d8
commit b6f304e91a

View File

@@ -516,6 +516,10 @@
(vm-push vm (inc (vm-pop vm)))
(= op 175)
(vm-push vm (dec (vm-pop vm)))
(= op 112)
(let
((request (vm-pop vm)))
(error (str "VM: IO suspension (OP_PERFORM) — request: " request)))
:else (error (str "VM: unknown opcode " op))))))
(define