explaingit

boa-dev/boa

7,235RustAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

A JavaScript engine written in Rust that lets you embed and run JavaScript code inside any Rust program, without needing a browser or Node.js.

Mindmap

mindmap
  root((Boa))
    What it does
      JS engine in Rust
      Embed scripting
      90 percent ECMAScript
    Components
      Lexer and parser
      AST crate
      Execution engine
      Garbage collector
    Use Cases
      Desktop scripting
      CLI tools
      Plugin systems
    Tech Stack
      Rust
      WebAssembly
      ECMAScript Test262
    Setup
      Add Rust dependency
      MIT or Unlicense
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Embed a JavaScript scripting engine into a Rust desktop application so users can write custom scripts.

USE CASE 2

Evaluate user-provided JavaScript expressions at runtime inside a Rust CLI tool.

USE CASE 3

Build a plugin system for a Rust application where plugins are written in JavaScript.

USE CASE 4

Test JavaScript spec compliance using the command-line tool against local JS files.

Tech stack

RustJavaScriptECMAScriptWebAssembly

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Rust toolchain, engine is experimental and not production-hardened for all JavaScript use cases.

Use freely for any purpose with no restrictions, choose between MIT or the Unlicense.

In plain English

Boa is a JavaScript engine written in Rust. Its purpose is to read and run JavaScript code from within a Rust program, without needing a browser or Node.js. You add the engine as a dependency to your Rust project, pass it a string of JavaScript, and it executes that code and returns the result. This makes it useful for embedding scripting capabilities into desktop applications, command-line tools, or any Rust program that needs to evaluate user-provided JavaScript at runtime. The engine currently supports more than 90% of the modern ECMAScript specification, which is the formal standard that defines what JavaScript is. The project tracks its own conformance results publicly via the ECMAScript Test262 test suite, a standard set of tests used across all JavaScript engines to measure spec compliance. You can view the exact conformance scores on the Boa website. There is also an online playground where you can try the engine directly in your browser via WebAssembly. Boa is organized as a collection of smaller Rust crates (packages), each handling a specific piece of the JavaScript pipeline: one for lexing and parsing source code, one for the abstract syntax tree, one for the execution engine and built-in objects, one for garbage collection, and one for runtime web APIs. A command-line tool called boa_cli lets you run JavaScript files directly from your terminal, inspect the abstract syntax tree, and generate flow graphs of the compiled instructions. The project is experimental, meaning it is functional but not production-hardened for all use cases. If JavaScript code fails to run correctly in Boa, the team treats that as a bug. Contributions are welcomed, and there are community channels on both Discord and Matrix for questions. The license is MIT or the Unlicense, your choice.

Copy-paste prompts

Prompt 1
Show me how to embed the Boa JavaScript engine in a Rust project and evaluate a JavaScript string, then read the returned value.
Prompt 2
How do I expose a Rust function to JavaScript code running inside the Boa engine?
Prompt 3
Use Boa to build a Rust CLI tool that reads a .js file from disk and executes it, printing the result.
Prompt 4
How do I add a custom module loader to Boa so that JavaScript import statements resolve to files on disk?
Prompt 5
Show me how to run the Boa REPL from the command line to interactively test JavaScript expressions.
Open on GitHub → Explain another repo

← boa-dev on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.