Skip to content

Repository files navigation

quickjs-oxide

An unsafe-free Rust rewrite of QuickJS, targeting semantic Feature Parity with the official QuickJS 2026-06-04 release and its ES2025 behavior.

The engine is runnable, but it is not at Feature Parity yet. Implemented slices include binary data and Atomics, collections and weak references, Promise jobs, Unicode behavior, class elements, and static-module graphs with live bindings, top-level await, import attributes, JSON modules, import.meta, and dynamic import(). The Rust embedding API and file-module CLI also expose QuickJS's canonical, host-populated import.meta object. JavaScript-valued module-host errors retain their exact values and object/Symbol identity. Context-aware module-host callbacks can synchronously compile and return same-Context modules, including nested loader re-entry protected by a finite host-stack budget. Parse-in-progress module identities and source-order request prefixes are visible to those callbacks in QuickJS order, with unsafe failed identities represented deterministically. Script, ECMAScript Module, and JSON-module loader boundaries accept byte-exact source buffers, and the file CLI preserves those bytes end to end. The remaining conformance gaps are still parity work.

The authoritative R3fb Test262 baseline records 79,597 full-corpus passes out of 102,037 variants (78.008%), with 79,647 eligible variants (78.057%). The 79,597 / 79,647 runnable pass rate (99.937%) is a secondary quality measure, not the headline compatibility metric.

Open the browser playground → — it runs this Rust engine's actual WebAssembly build, not host eval. The page reports its exact build commit, QuickJS target, and browser host policy. Its curated Script-goal examples include a function returning 42 and the Atomics.wait boundary. The playground is a pre-parity milestone, not a Feature Parity claim.

Try it

Rust 1.88 or newer is required.

git clone https://github.com/pocket-stack/quickjs-oxide.git
cd quickjs-oxide
./scripts/demo-42.sh  # 42
cargo run --quiet --bin qjs -- --print-result -e \
  '(function (a) { return a + 1; })(41)'  # 42
cargo run --quiet --bin qjs -- -e 'console.log({ answer: 42 })'
# File modules: -m/--module, --script, .mjs and source detection
cargo run --quiet --bin qjs -- examples/module-42.mjs  # 42

The file loader follows QuickJS policy: .json is strict JSON, type: "json5" selects QuickJS extended JSON for any suffix, and a .json5 file without that attribute remains a JavaScript module. Main files and dependencies are read as explicitly sized byte buffers.

Status

Verify

cargo test --locked --workspace --all-targets
./scripts/test-test262.sh --check
./scripts/test-test262.sh --focused
TEST262_WORKERS=2 ./scripts/test-test262.sh --full
./scripts/test-web-playground.sh
npm ci && npx playwright install chromium && npm run test:browser

License

MIT. Third-party notices: NOTICE, LICENSES.

About

An independent Rust rewrite of QuickJS targeting semantic feature parity

Resources

Stars

53 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages