Suspended while waiting, resumed elsewhere
A run can be suspended while it waits, saved to bytes, and resumed later, in the same process or another one.
Source:Psychoscript, README
Psychoscript is a confined, resumable JavaScript interpreter from Anomaly, the makers of opencode. It is the shortest path to running model-written code inside a Node.js or Bun app. Here is where it and tinyscript part ways.
An agent that waits minutes for a tool can't keep a whole process alive for each run it has parked.
Psychoscript compiles a strict-mode subset of JavaScript to bytecode and runs it on a VM written in TypeScript, inside your JavaScript process. There is no WebAssembly and no native addon: you install it from npm.
Its centre is durability. A run that waits on a host call can be saved to bytes and resumed in another process, so a long-running program survives a restart.
Ignore the satirical "NormalScript" marketing on its site. The README is precise, and names its own gaps.
A run can be suspended while it waits, saved to bytes, and resumed later, in the same process or another one.
Source:Psychoscript, README
A subset chosen for safety is also a list of code that will not run.
Psychoscript rejects eval, new Function, Proxy, Reflect, private members and TypeScript syntax by design. tinyscript compiles new Function through the same compiler, runs Proxy and Reflect, and reads TypeScript as compiler hints.
| Question | Psychoscript | tinyscript |
|---|---|---|
| Language | A subset; 19,802 of the 22,469 test262 files it keeps | 62.9% of all of test262 in strict mode |
| TypeScript | Rejected | Erased, used as hints |
| Bounding a call | Active time, checked between steps | Exact fuel; the call continues |
| Clock and randomness | Host's own; no seed option | Always the host's |
| Where it runs | Node.js, Bun, browsers; a Rust VM too | A C library and a command-line tool |
The two test262 numbers count different things: Psychoscript's its own kept files, tinyscript's every strict-mode test. Don't set them side by side as one measure.
Most readers need one answer: which engine to try first.