Skip to content(if available)orjump to list(if available)

Boa: A standard-conforming embeddable JavaScript engine written in Rust

jayflux

Hi all, wow was not expecting this to be trending right now.

I’m the creator of Boa, you can catch my talk about it at JS Conf EU 2019 https://www.youtube.com/watch?v=_uD2pijcSi4

That said, today Boa has a whole team of maintainers who I’m sure will answer some questions here.

Yes the name does invoke the sense it’s a Python project but I liked it and stuck with it, I saw a Boa snake at a zoo once and knew I wanted to name my next project after it, I was also inspired by Mozilla at the time who named their projects after animals.

Speaking of Mozilla, Boa’s existence came to be because at the time I was working on Servo and wanted to include an all-rust JS engine, one didn’t really exist so I set about making one as a learning exercise, after around 2 years more joined me on that journey and today Boa is around 8 years old. It is not browser grade (although at 94.12% it is more compliant than some browser engines) but that doesn’t matter, plenty of Rust projects have found good use for it as they find it easy to embed and use, so we’re happy.

One recent example is Biome who use it for their plugin infrastructure. https://github.com/biomejs/biome/pull/7300

Another recent thing which we’re very proud is seeing our implementation of Temporal be used in V8 and other engines, so we’re also helping the wider ecosystem and raising all ships! (More here: https://boajs.dev/blog/2025/09/24/temporal-release)

We do hope to improve performance over the next year or so, hopefully that answers some of the Qs here.

vlovich123

Do you see catching up on performance with v8-jitless as a goal or is conformance the primary goal right now? Any plans on doing a JIT? I was always impressed by the idea of Truffle where you implement the language semantics once and you get both interpreter and JIT safely out of it which is a huge source of vulnerabilities in traditional JIT systems

ComputerGuru

Nice to see another contender in this space. If OP is here, can you comment on runtime sandboxing and interop support? Can I selectively disable (or intercept) certain features like network support?

qbane

I am not meant to be harsh, but note that it fails on a small number of test cases, on v0.21 that is ~900 out of ~50k. Strictly speaking it cannot be described as standard-comforming unless there is some reason behind every failed test. A better way to strive on standard conformance, like QuickJS takes, is to pin down the ecma262 revision and make it 100% compliant.

k__

Awesome!

I'm always on the lookout for embeddable JS engines.

How hard would it be to make Boa deterministic?

Like, with seeded randomness, etc.

sebastianconcpt

What's the use case?

mort96

There's typically a pretty big difference between an interpreter meant to be embeddable and one that's not. Trying to embed V8 and keep up with V8 API changes would be a huge amount of work. I could see myself using something like this instead of Lua for some projects where V8 would be too much.

My first thought was that this could be interesting for yt-dlp?

jasonjmcghee

Likely similar to something like https://github.com/mlua-rs/mlua - but wanting to execute javascript (instead of lua, and no static libs?) in the context of native rust.

The alternative might be https://github.com/denoland/rusty_v8 but without needing C++ V8.

(this is the first I'm hearing of Boa)

written-beyond

This mad man had the courage to present BOA a rust project at JS Conf. The project had it's spotlight taken by Bun and Deno. I also think the project was progressing pretty slowly from what people were expecting.

jasonjmcghee

Seems pretty relevant- are JS Conf folks notoriously anti-rust or something?

ModernMech

Feels like a better name for an embeddable Python engine written in Rust.

delduca

Lua is the best for embedding.

speps

With projects like this competing against well known massive competitors (eg. the browser JS engines), not seeing their main competitors in a benchmark is a massive red flag to me: https://boajs.dev/benchmarks

Not seeing V8, SpiderMonkey JavaScriptCore is very strange...

0cf8612b2e1e

This is offering a JS scripting layer in an otherwise Rust project. Performance is nice, but probably not a requirement.

jitl

Both SpiderMonkey jitless (sm-jitless) and v8 jitless are on the benchmarks page, if you click the checkboxes you will see them in the graphs.

gr4vityWall

It's an embedded engine for scripting a bigger application. Its main "competitor" would be QuickJS.

Though they aren't really competing on anything as far as I can tell, so maybe calling it a "similar project" is more fitting.

mort96

It's not competing with V8, SpiderMonkey and JavaScriptCore.

IshKebab

Well, it is, because V8 is definitely an embeddable JS engine. For many people they might want to make a choice between V8 and Boa and for them the performance numbers are important information!

mort96

People who need an extremely high performance JavaScript engine, where the extra performance is worth using an engine that's hard to embed, has an unstable API, and an absolutely massive unwieldy Google-style C++ code base with all the pain that entails, plus a JIT and all the limitations that entails, JITed V8 is the right choice.

People who just want to run JavaScript code where performance isn't such a big concern would prefer something like Boa (or the other engines listed on the comparison benchmark page).

Both have their uses, and their use case is almost entirely non-overlapping. You wouldn't choose Boa for a competitive web browser engine or as the runtime for your back-end server software. You would consider it for a plug-in system, or maybe a game's scripting system.

baq

It isn't, v8 will have anywhere between 2-1000x performance depending on the exact code it's jitting. Boa absolutely destroys v8 here though:

    use boa_engine::{Context, Source, JsResult};
    
    fn main() -> JsResult<()> {
      let js_code = r#"
          let two = 1 + 1;
          let definitely_not_four = two + "2";
    
          definitely_not_four
      "#;
    
      // Instantiate the execution context
      let mut context = Context::default();
    
      // Parse the source code
      let result = context.eval(Source::from_bytes(js_code))?;
    
      println!("{}", result.display());
    
      Ok(())
    }

le-mark

Is it though? V8 and spider monkey both have jits so performance numbers of the form “wow V8 is vastly faster than any of these other ones!” (similarly for sm). Does that really have any value?

vlovich123

V8-jitless is in the benchmarks and even then still blows it away, as does quickjs.