zig-js

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.

test262 · valid — can we run it? 100%
48506 / 48506 valid tests passing · real (pinned tc39/test262 submodule) · updated 2026-07-28
48506
passing
0
parse-fail
0
runtime-fail
100%
negative (strictness)
0
skipped

The map

// syntax

Language

Classes with private fields and static blocks, generators, async/await, modules, destructuring, optional chaining, explicit resource management.

// stdlib

Built-ins

Object, Array, String, Map/Set, Promise, Proxy/Reflect, Symbol, BigInt, RegExp, iterator helpers, and the Error family.

// i18n

Intl & Temporal

Ten Intl constructors over checked-in CLDR/IANA tables, plus the Temporal date/time namespace.

// host

Web-shaped APIs

Timers, URL, TextEncoder/TextDecoder, Headers/Request/Response, Blob, FormData, AbortController, structuredClone.

// bytes

Binary data

ArrayBuffer with resize/transfer/immutable, all twelve typed arrays, DataView, SharedArrayBuffer, Atomics.

// parallel

Concurrency

GIL-free shared-realm Threads, Workers, agents, and property-mode Atomics on real OS threads.

Pages

PageCovers
LanguageSyntax and semantics: declarations, functions, classes, generators, async, modules, resource management.
Built-insThe standard library and the global object.
Binary dataArrayBuffer, typed arrays, DataView, SharedArrayBuffer, Atomics.
Intl & TemporalInternationalization constructors and the Temporal namespace.
Web-shaped APIsTimers, URL, encoding, fetch data types, abort signals, structured clone.
ConcurrencyThreads, Workers, agents, and what is shared between them.
WebAssemblyThe 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; a print global exists for harness use. Embedders install their own logging.
  • No module resolver. Context.evaluateModule takes 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.