Repolode
boa-dev

boa-dev/boa

An embeddable JavaScript engine written in Rust, providing a lexer, parser and interpreter with broad ECMAScript spec support.

Stars
7,661
Forks
689
Open issues
223
Last commit
7 days ago

What is it?

Boa is a JavaScript lexer, parser and interpreter written in Rust. It aims to implement more than 90% of the latest ECMAScript specification and is developed with ongoing conformance work tracked against the Test262 suite.

The engine is distributed as a set of Rust crates. The main crate, boa_engine, lets Rust applications create an execution context and evaluate JavaScript source code directly. Supporting crates cover the AST, parser, garbage collector, string interner and WebAPI-style runtime features, and the project also ships a CLI and REPL for running JS files from the terminal.

Boa can be compiled to WebAssembly, and the project offers a live browser playground. Its README notes a dedicated setup for the wasm32-unknown-unknown target that involves enabling a feature flag and configuring getrandom.

Key features

  • 01Lexer, parser and interpreter for JavaScript written in Rust.
  • 02Targets more than 90% of the latest ECMAScript specification.
  • 03Embeddable through the boa_engine crate with a simple eval API.
  • 04Includes a CLI and REPL with AST dumping and optimizer options.
  • 05Can be compiled to WebAssembly and includes a browser playground.

Use cases

  • Running JavaScript inside a Rust application without depending on a C++ engine.
  • Evaluating user-supplied scripts or expressions in a sandboxed Rust host.
  • Experimenting with JavaScript language implementation or engine internals.
  • Running JavaScript in WebAssembly environments.

Quick start

  1. 1

    Add the boa_engine crate to Cargo.toml

    cargo add boa_engine
  2. 2

    Copy the example code into main.rs

  3. 3

    Run the project

    cargo run

Things to know

  • Described by its authors as experimental, so it may not suit production use yet.
  • Not yet fully conformant with the ECMAScript spec; it claims more than 90% support.

Topics

FAQ

What is boa?
An embeddable JavaScript engine written in Rust, providing a lexer, parser and interpreter with broad ECMAScript spec support. Boa is a JavaScript lexer, parser and interpreter written in Rust. It aims to implement more than 90% of the latest ECMAScript specification and is developed with ongoing conformance work tracked against the Test262 suite.
Is boa free to use? What license does it have?
boa is open source under the MIT license. Check the license terms before using it in commercial products.
Is boa still maintained?
Actively maintained. The last commit to boa was on Oct 31, 2026.
What can I use boa for?
Running JavaScript inside a Rust application without depending on a C++ engine. Evaluating user-supplied scripts or expressions in a sandboxed Rust host. Experimenting with JavaScript language implementation or engine internals. Running JavaScript in WebAssembly environments.
How do I install boa?
Add the boa_engine crate to Cargo.toml: cargo add boa_engine Copy the example code into main.rs Run the project: cargo run
Where can I get boa?
The source code and installation instructions are on GitHub: https://github.com/boa-dev/boa

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects