JavaScript that asks your application before it acts

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.

Read the referenceSee how it works

No clock, file or socket of its own

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.

Fewer instructions than QuickJS on 17 workloads

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.

WorkloadtinyscriptQuickJSChange
Clamp a retry deadline with Math.min and Math.max31,802,37895,503,89166.7% fewer
Dispatch decoded telemetry event tags44,218,969105,763,16358.2% fewer
Select a delivery policy for each event4,991,7769,702,99148.6% fewer
Branching reconnect policy221,553,748328,454,10432.5% fewer
Deduplicate message IDs within each batch31,287,52535,740,03812.5% fewer
Fold delivered byte counts across telemetry batches4,079,3934,074,7940.1% more
Instructions retired, counted by Callgrind 3.24.0 on an AMD EPYC 9V74 at tinyscript commit 18ad163d, 4 December 2026, against QuickJS's 2026-06-04 release. Six of the 18 workloads.

All 18 workloads, with how to rerun them

The results list every workload, QuickJS-ng beside upstream QuickJS, and the commands that reproduce the counts.

Source:tinyscript, bench/RESULTS.md

Bound each call's time and memory

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.

Standard WebAssembly you can inspect

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.

Custom sections carry the rest

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

TypeScript types become layout predictions

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.

A type is a hint, not a promise

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

Every feature with its status

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.

Read the referenceLearn the words