Skip to content

tts Engine & VM (Contract v19)

tts compiles a deterministic, prototype-free TypeScript subset into a 41-opcode bytecode VM (strictly within a 45-opcode verification ceiling) with zero runtime syscalls or I/O.

Key Engine Capabilities (Engine Contract v19)

Section titled “Key Engine Capabilities (Engine Contract v19)”
  • Preemptive isolation on 1 OS thread: Each live actor executes inside its own power-of-two buddy-allocated virtual memory region capped by --cap and --alloc, with instruction-fuel preemption so hostile infinite loops cannot starve neighbors.
  • Linear-time ReDoS-proof RegExp: Regex literals compile to bounded <= 256-state Thompson NFAs executed in a fuel-metered PikeVM (i/g/m/s, up to 9 captures, .test(), .match(), .replace(), .split()), making catastrophic backtracking impossible.
  • Zero-opcode async CPS lowering: export async function handle(state, msg, caps) suspends across await caps.http(...) / peer / timer boundaries with try/catch/finally, labelled break/continue, do ... while, and Lean-proved cps_frame_isolation_sound.
  • Transactional state invariants: export function invariant(state) executes at spawn, every await suspension, and terminal return—rolling back any violating turn cleanly while keeping committed state intact.
  • Rich strict TypeScript subset: Local .ts module bundling, interface extends, type aliases, Map<string, V> & Set<string>, rest destructuring, inline array .map/.filter/.reduce/.flatMap callbacks, encodeURIComponent/decodeURIComponent, btoa/atob, exact JSON.parse/stringify, and --compare-node parallel unit tests.