finds.dev← search

// the find

mitchellh/zig-js

★ 287 · Zig · MIT · updated Apr 2026

Access the JS host environment from Zig compiled to WebAssembly.

A Zig library (with a companion TypeScript/JS package) that lets Zig code compiled to WebAssembly call into a JS host environment — get/set object properties, call functions, that kind of thing. It's for Zig developers building for the browser who need DOM/JS access without writing a full bindgen layer; think Go's syscall/js, not wasm-bindgen.

The NaN-boxing scheme for passing refs across the WASM/JS boundary (which only supports numeric types) is a genuinely clever piece of engineering, and it's explained clearly in the README instead of left as a black box. The scope is deliberately narrow — Zig-calls-JS only, no attempt at bidirectional codegen — which keeps the API small and the failure modes predictable. It ships both halves (Zig package and JS/TS glue) instead of leaving you to hand-roll the host side.

There's no protocol stability guarantee at all — the README flatly states the Zig and JS versions must match and you're on your own to check tagged commits for compatibility, which is a real landmine if this ends up as a transitive dependency. Every single property access or function call crosses the WASM/JS boundary individually, and the author is upfront that this is slow and not how you'd want to use WASM for anything performance-sensitive. The JS package still isn't published to npm (README says 'in the future'), so you're vendoring or git-installing it. It's also a one-person project with a fairly small star count and no visible roadmap beyond the initial design, so don't expect fast turnaround on issues.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →