This header animation runs WebAssembly compiled by JZ.

Loading…

Compute-first
JS
compiling
to WASM

What is JZ?

JZ (javascript zero) compiles JavaScript ahead of time to a plain .wasm module: no engine, no GC, no type annotations, auto-SIMD, byte-identical output.

Valid JZ is valid JS – drop the compile step and the same file keeps running.

Good for Not for
DSP, audio, synthesis UI, DOM, frontend
Images, video, pixels Network, hot I/O, serving
Simulation, physics, games Dynamic objects, monkey-patching
Parsers, codecs, compression Allocation-heavy, long-lived states
Scientific, numeric, edge ML Security, cryptography, arbitrary-precision integers
Hashing, checksums, RNG Tiny calls where the JS/WASM boundary dominates

How do I use it?

import jz from 'jz'
const { exports } = jz`export const square = x => x * x`
exports.square(7) // 49

Guide →

Is it fast?

What is not supported?

Runtime-generated codeProxies & reflectionDynamic prototype chainsBrowser DOMNode.js APIsIntl & Temporal

Language support →

Why no types?

JZ infers types from your code.

Why not AS, scriptc, Porffor, ...?

  • AssemblyScript: TypeScript-ish.
  • scriptc: fails to run benches.
  • Porffor: nice but broad, not fast.
  • Javy: QuickJS runtime in WASM.
  • Perry: TypeScript → native apps.

Benchmarks →

Can it go native?

Yes.

  1. jz
  2. wasm2c
  3. clang -O3

Native guide →

Can it compile itself?

Yes. self-compile CI status

Is it production ready?

Unstable yet, pre-1.0.0, but main contract gets stabilized soon.

Examples

Raymarcher Lorenz Boids N-body Metaballs Mandelbrot Julia Buddhabrot Plasma Game of Life Chladni Phyllotaxis Attractors Newton Penrose Black Hole Lenia Apollonian Gasket Hydrogen Orbitals Barnsley Fern Voronoi Truchet Tiles Burning Ship More →

Inspiration

JS is not a "real" language: runtime with JIT, GC hits, language quirks. Spec only adds and never deprecates.

There is good minimal, functional subset, Crockford’s good parts. I didn't want to migrate to other languages, I just wanted JS that is good: fast, minimal. So I attempted to save the best parts and drop the legacy, OOP, classes, runtime. Javascript Zero.

I am not a compiler engineer, so I had to go in steps: subscript parser first (sparse arrays proved to be fast!), then watr compiler. Then JZ. Foundation was done by hand, AI took off the details.

The ambition: faster than V8/JSC (otherwise what's the point?), smaller than AssemblyScript, JZ ⊂ JS.