A lightweight, embeddable JavaScript engine written in Rust, inspired by
QuickJS-ng. rjs targets ES2024+
with a focus on correctness, memory safety (zero unsafe in production code
paths), small binary size, and competitive interpreter performance — with no
JIT, so it runs anywhere QuickJS does (including iOS and WebAssembly).
- ES2024+ language: classes, private fields, generators, async/await,
modules, destructuring, tagged templates, optional chaining,
BigInt,Symbol - Full RegExp: Unicode property escapes, named groups, lookbehind
- Safe by construction: NaN-boxed values, shape-based objects, reference
counting with a cycle collector — all without
unsafein hot paths - Small and embeddable: workspace of focused crates (
core,parser,vm,builtins,regexp,unicode) with a tiny CLI on top - Conformance-driven: a bundled Test262 runner tracks parity with upstream — current baseline ~83.8% of the curated suite
Requires a stable Rust toolchain (edition 2024, pinned in
rust-toolchain.toml).
git clone https://github.com/tyrchen/rjs
cd rjs
git submodule update --init --recursive
make buildRun a script:
make run ARGS=path/to/script.jsOr launch the REPL:
make repl- User guide — install, running scripts, REPL, supported language surface, current limitations
- Developer guide — workspace layout, build/test/lint, Test262 runner, contributing
- Docs index
- Design & planning specs
apps/
rjs/ CLI entry point (file runner + REPL)
test262-runner/ Test262 conformance driver
crates/
core/ Values, objects, GC, runtime, context
parser/ Lexer + single-pass parser → bytecode
vm/ Bytecode interpreter
builtins/ Built-in objects
regexp/ RegExp compiler + backtracking NFA
unicode/ Unicode tables and algorithms
| Command | What it does |
|---|---|
make build |
Build the workspace |
make test |
Run the full test suite via cargo nextest |
make check |
fmt + lint + test (pre-commit gate) |
make run ARGS=foo.js |
Execute a JavaScript file |
make repl |
Start the interactive REPL |
make test262-runner |
Run the Test262 conformance driver |
See the developer guide for the full list.
Distributed under the terms of MIT.
See LICENSE for details.
Copyright 2025 Tyr Chen