v0.6.0 · See what's new

One JavaScript API.
Every engine, in Rust.

Rong (融) is a JavaScript runtime for Rust with a unified API over QuickJS, JavaScriptCore, and ArkJS — built for embedding, Rust-driven JS APIs, and long-lived worker runtimes.

cargo add rong --features quickjs,tls-aws-lc
  • QuickJS
  • JavaScriptCore
  • ArkJS
3 JavaScript engines
20 built-in modules
1.95+ Rust toolchain (2024 edition)
MIT / Apache-2.0 dual licensed
Why Rong

Fusion, harmony, and flow — by design.

In Chinese, 融 means to merge and harmonize. Rong fuses JavaScript engines with Rust native code, unifying diverse runtimes under a single, elegant API.

Unified API

Write once, run anywhere. The same Rust code drives QuickJS, JavaScriptCore, and ArkJS — engines are selected at build time, with no engine-specific branches in your code.

Declarative class bindings

Expose Rust structs to JavaScript with #[js_class] and #[js_method] — constructors, getters, setters, and static methods, all type-checked by Rust.

Async / await

First-class Promise and async iterator integration so JavaScript and Rust futures interleave naturally across the engine boundary.

Worker pools

Choose your execution model explicitly: shared() workers for stateless work, pinned() workers for keyed state that must live on the same long-lived runtime.

Bounded execution

Apply task deadlines across queueing and execution, interrupt non-yielding JavaScript where the engine supports it, and reuse workers safely after timeout.

TypeScript & tooling

Type definitions ship as @rongjs/rong on npm, and @rongjs/rong-skill packages an installable agent skill with generated API references.

Multi-engine support

Three engines, one codebase.

Engines are mutually exclusive and chosen at build time — if multiple engines are enabled, the build fails fast. The library ships no default; downstream crates select an engine and TLS backend explicitly.

Default · Desktop

QuickJS

Lightweight and fast. The default engine for the Rong CLI on desktop hosts, paired with the aws-lc TLS backend.

Apple system + source builds

JavaScriptCore

Links the system JavaScriptCore.framework on macOS and iOS, or uses pinned source-built WebKit/JSCOnly artifacts on supported targets. Windows source artifacts are currently unavailable.

HarmonyOS / OpenHarmony

ArkJS

The HarmonyOS JavaScript engine, for aarch64 OpenHarmony targets with the ring TLS backend.

Architecture

A unified core over swappable engines.

The Rong core provides the unified API, type system, memory management, and async layer. Engines and built-in modules plug in beneath it.

Rong Core
Unified APIType SystemMemory ManagementAsync / Await
QuickJS JavaScriptCore ArkJS
Built-in Modules & Extensions
TimerHTTPFSConsoleS3SQLiteRedisWorker
Quick start

From zero to evaluating JS in seconds.

Add the dependency, pick an engine, and run JavaScript from Rust — or expose Rust classes to JavaScript.

use rong::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a JavaScript runtime and context
    let rt = RongJS::runtime();
    let ctx = rt.context();

    // Execute JavaScript directly
    let result: i32 = ctx.eval(Source::from_bytes(b"2 + 3"))?;
    println!("Result: {}", result); // Result: 5

    Ok(())
}
Agent skills

Teach your AI agent Rong.

@rongjs/rong-skill bundles three installable agent skills — self-contained SKILL.md documents with generated API references, for any agent runtime that supports file-based skills.

rong-runtime-embedder

Build Rust hosts around Rong runtimes, choose module capabilities, supervise worker lifecycles, and apply cancellation, deadlines, and interruption correctly.

rong-runtime-developer

Write Rong JavaScript scripts, choose the right public APIs, adapt examples, run rong_cli, and compile bytecode.

rong-module-author

Write or edit Rust modules that expose Rong APIs, classes, functions, type conversions, and JavaScript errors.

npx @rongjs/rong-skill install

Use --project for a project-local install, or --skill <name> to install just one. The skills share their source with the module API docs on this site — one source of truth.

Bring JavaScript into your Rust application.

Embed a runtime, expose Rust-driven APIs, and scale with worker pools — across every supported engine.