o-

Engine Backends

Notes on SpiderMonkey, JavaScriptCore, and V8 support.

Overview

o- can run JavaScript on multiple engine backends behind the same JSEngine interface.

SpiderMonkey

Path:

toolchains/spidermonkey

Notes:

  • Loads the shared jstd bootstrap before running user code.
  • Uses a dedicated SpiderMonkey runtime wrapper.
  • Runtime teardown is currently treated conservatively to avoid shutdown-time crashes in this embedding.

JavaScriptCore

Path:

toolchains/javascriptcore

Notes:

  • Uses rust_jsc.
  • Registers shared host callbacks and then evaluates the same jstd bootstrap used by the other engines.

V8

Path:

toolchains/v8

Notes:

  • Uses the Rust v8 bindings.
  • Initializes the V8 platform once, then creates a fresh isolate/context for each run.
  • Installs the same __jstd_* host callbacks and executes the shared bootstrap before evaluating your script.

Shared Contract

All engines are expected to:

  1. implement the shared JSEngine trait from o-core
  2. return the shared JSError / JSResult types
  3. expose the jstd host hooks needed by the bootstrap script
  4. make common built-ins behave the same way where possible

On this page