Skip to content
/ SO2JS Public

SO2JS is a fork of [Brimstone](https://github.com/Hans-Halverson/brimstone) JS engine which written from scratch in Rust, aiming to have full support for the JavaScript language.

License

Notifications You must be signed in to change notification settings

LemonHX/SO2JS

Repository files navigation

SO2 JS

read as Sulphur Dioxide JS

  • debugger
  • rust native memory allocator
  • oxc's js parser
  • crate rust's future beside js's loop
  • add promise hook
  • add compat to serde_json

SO2JS is a fork of Brimstone JS engine which is a JavaScript engine written from scratch in Rust, aiming to have full support for the JavaScript language.

SO2 Brimstone Implements the ECMAScript specification. Heavy inspiration is taken from the design of V8 and SerenityOS's LibJS. Brimstone chooses to implement almost all components of the engine from scratch with minimal dependencies, with the notable exception of ICU4X.

Features

  • Bytecode VM, heavily inspired by the design of V8's Ignition
  • Compacting garbage collector, written in very unsafe Rust
  • Custom RegExp engine
  • Custom parser
  • Almost all builtin objects and functions implemented to spec

Building and testing

Standard cargo commands to build and run.

  • cargo build to build the bs executable
  • cargo run to run from source

JavaScript files can be executed with bs:

# Build brimstone
cargo build

# Execute a JavaScript file
./target/debug/bs ./hello.js
Hello world!

Testing

SO2(Brimstone) relies heavily on a set of first and third party integration test suites, most notably the official test262 test suite. A custom integration test runner is included. This can be run with:

cargo brimstone-test

Unit and snapshot tests can be run with cargo test.

Fuzz testing can be run with ./tests/fuzz/run.sh.

For more information on testing see the testing README.

Missing features

All features up to ES2024 have been implemented, as well as all stage 4 proposals as of the Feb. 2025 TC39 meeting, except for the following features:

  • SharedArrayBuffer
  • Atomics

About

SO2JS is a fork of [Brimstone](https://github.com/Hans-Halverson/brimstone) JS engine which written from scratch in Rust, aiming to have full support for the JavaScript language.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages