Effects cross a message boundary
The runtime parks an invocation on a request and resumes it on a validated reply with the same request number.
tinyscript compiles JavaScript and TypeScript to a standard WebAssembly module and runs it with a small interpreter inside your application. Every clock read and message goes through your code.
A script that reads the clock or opens a socket inside your engine is a script you can't replay or bound. tinyscript's core has no ambient filesystem, clock, output or random source.
A program asks for each of them as an effect. The interpreter parks the call, and your code replies when it chooses.
The runtime parks an invocation on a request and resumes it on a validated reply with the same request number.
Callgrind counted the instructions each engine retired on the same 18 JavaScript workloads, with identical output required. tinyscript retired fewer than upstream QuickJS on 17 of them.
It lost one: folding byte counts across telemetry batches took 0.1% more.
| Workload | tinyscript | QuickJS | Change |
|---|---|---|---|
Clamp a retry deadline with Math.min and Math.max | 31,802,378 | 95,503,891 | 66.7% fewer |
| Dispatch decoded telemetry event tags | 44,218,969 | 105,763,163 | 58.2% fewer |
| Select a delivery policy for each event | 4,991,776 | 9,702,991 | 48.6% fewer |
| Branching reconnect policy | 221,553,748 | 328,454,104 | 32.5% fewer |
| Deduplicate message IDs within each batch | 31,287,525 | 35,740,038 | 12.5% fewer |
| Fold delivered byte counts across telemetry batches | 4,079,393 | 4,074,794 | 0.1% more |
18ad163d, 4 December 2026, against QuickJS's 2026-06-04 release. Six of the 18 workloads.The results list every workload, QuickJS-ng beside upstream QuickJS, and the commands that reproduce the counts.
Source:tinyscript, bench/RESULTS.md
An engine that allocates as it pleases turns one script's spike into every tenant's outage. tinyscript compiles in a workspace your application supplies, and each call runs in an arena its invocation owns.
The interpreter counts fuel as it runs, so your application decides how long a call may run.
The interpreter counts fuel, so that an application can bound how long a call may run.
Source:tinyscript, docs/compiler.md
The compiler works in one block of memory the request supplies. An invocation owns an arena, which a tracing collector compacts.
An image is an ordinary WebAssembly module, so standard tools read it. tinyscript's own data, such as source positions and layouts, travels in custom sections that other hosts may ignore.
The command-line tool disassembles an image, and a debug build carries its source text.
Sections such as tinyscript.abi and tinyscript.positions say how exports take values and where each call and throw is in the source.
Source:tinyscript, docs/compiler.md
tinyscript parses erasable TypeScript itself, with no separate build step. A record type tells the compiler which slot a field is likely in.
The run time checks each prediction, so an object of another shape still works through ordinary lookup.
Reading session.attempt on a parameter typed { id: number, attempt: number } tries the second own slot first, and looks the property up normally when the key there differs.
Source:tinyscript, README.md
tinyscript compiles a profile of JavaScript, not all of it yet. The reference names each feature as MDN does and says whether it is implemented, partial, planned or excluded.
A construct the compiler has no case for fails with an error that names it, instead of a guess.