Skip to content

Choosing a Runtime

xript provides four runtime implementations that all conform to the same specification. A script written for one runtime works identically on the others — the manifest schema, capability model, and security guarantees are shared across all of them.

UniversalNode.jsRustC#
Package@xriptjs/runtime@xriptjs/runtime-nodexript-runtimeXript.Runtime
SandboxQuickJS WASMNode.js vmQuickJS (native)Jint (pure C#)
EnvironmentsBrowser, Node, Deno, Bun, WorkersNode.js onlyAny Rust appAny .NET app
Manifest loadingPass object directlycreateRuntimeFromFilecreate_runtime (JSON)XriptRuntime.Create (JSON)
Async bindingsVia initXriptAsync()Native async/awaitNot yet (sync only)Not yet (sync only)
Memory isolationSeparate WASM heapShared Node.js processSeparate QuickJS heapJint engine per runtime
Best forCross-platform, browserNode.js servers, CLIRust apps, game enginesUnity, Godot (.NET), enterprise

Every runtime enforces the same security model regardless of the host language or sandbox technology:

  • No sandbox escape. Scripts cannot access the host filesystem, network, or process. Only bindings declared in the manifest are reachable.
  • No denial of service. Execution limits (timeout_ms, memory_mb, max_stack_depth) prevent runaway scripts from consuming unbounded resources.
  • No implicit trust. Capabilities are opt-in and default to empty. A script cannot call a capability-gated binding unless the host explicitly grants that capability.
  • No eval. eval(), new Function(), and dynamic code generation are blocked at the engine level across all four runtimes.

For the full security specification, see Security.

All four runtimes consume the same xript.manifest.json schema. A manifest written for one runtime requires zero changes to work on another — the bindings, capabilities, hooks, types, and limits are all portable.

For the manifest specification, see Manifest.

  • JS/WASM Runtime — universal sandbox, runs anywhere JavaScript runs
  • Node.js Runtime — optimized for Node.js with file-based manifest loading
  • Rust Runtime — native QuickJS sandbox for Rust host applications
  • C# Runtime — Jint sandbox for .NET, Unity, and Godot applications