Features
On this page 10
zig-js is an embeddable JavaScript engine written from scratch in Zig. This section describes what the engine gives you. For how it runs that code, see Architecture and Advanced.
Everything here is scored against the pinned tc39/test262 corpus through the configured runner; see Conformance for the methodology and what sits outside the denominator.
The map
Language
Classes with private fields and static blocks, generators, async/await, modules, destructuring, optional chaining, explicit resource management.
Built-ins
Object, Array, String, Map/Set, Promise, Proxy/Reflect, Symbol, BigInt, RegExp, iterator helpers, and the Error family.
Intl & Temporal
Ten Intl constructors over checked-in CLDR/IANA tables, plus the Temporal date/time namespace.
Web-shaped APIs
Timers, URL, TextEncoder/TextDecoder, Headers/Request/Response, Blob, FormData, AbortController, structuredClone.
Binary data
ArrayBuffer with resize/transfer/immutable, all twelve typed arrays, DataView, SharedArrayBuffer, Atomics.
Concurrency
GIL-free shared-realm Threads, Workers, agents, and property-mode Atomics on real OS threads.
Pages
| Page | Covers |
|---|---|
| Language | Syntax and semantics: declarations, functions, classes, generators, async, modules, resource management. |
| Built-ins | The standard library and the global object. |
| Binary data | ArrayBuffer, typed arrays, DataView, SharedArrayBuffer, Atomics. |
| Intl & Temporal | Internationalization constructors and the Temporal namespace. |
| Web-shaped APIs | Timers, URL, encoding, fetch data types, abort signals, structured clone. |
| Concurrency | Threads, Workers, agents, and what is shared between them. |
| WebAssembly | The pure-Zig Wasm runtime, its JavaScript API, and post-MVP feature gates. |
Opting features in
Some capabilities are off by default and enabled per Context:
const ctx = try js.Context.createWith(gpa, .{
.enable_threads = true, // shared-realm Thread, Lock, Condition, ThreadLocal, Atomics
.enable_gc = true, // precise tracing GC instead of the arena
.enable_jit = true, // baseline native tier (default on)
.heap_limit_bytes = 64 << 20,
.wasm_features = .{ .fixed_width_simd = true },
});
defer ctx.destroy();
See Embedding for the full option surface and Memory & GC for what each allocator mode implies.
What is deliberately not here
- No
console. The engine ships no host I/O object; aprintglobal exists for harness use. Embedders install their own logging. - No module resolver.
Context.evaluateModuletakes a host hook; module resolution and file loading belong to the embedder. - Decorators are parsed and discarded. The syntax is accepted so decorated sources parse, but decorator application is not implemented.
- Skipped or excluded corpus categories are outside the denominator, not implemented. Conformance names them.
Open release gates and remaining work are tracked in
docs/.data/release-compatibility-matrix.json
and summarized in the README's "What Is Not Implemented" section.