5 ms·
Boa: A standard-conforming embeddable JavaScript engine written in Rust
- sebastianconcpt 1y agoWhat's the use case?
- jasonjmcghee 1y agoLikely similar to something like https://github.com/mlua-rs/mlua 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 https://github.com/denoland/rusty_v8 but without needing C++ V8. (this is the first I'm hearing of Boa)
- written-beyond 1y agoThis 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.
- afavour 1y agoBun and Deno are in totally different spaces to Boa IMO. Looks like Boa is comparable to QuickJS in the small embedded engine space.
- nekevss 1y agoWell the first two are runtimes built on top of JavaScriptCore and V8, respectively. So we're definitely in a different space. QuickJS/QuickJS-NG might be a better comparison, but I think they are limited in specification conformance or at least selective in specification conformance in favor of remaining in a single file and fast. For instance, I'm not entirely sure whether they will be supporting Temporal once it goes Stage 4 because of the size of the feature, and I don't think they support Intl. But I also can't speak for QuickJS.
- written-beyond 1y agoDoesn't matter, they were more exciting and relevant for Devs.
- jasonjmcghee 1y agoSeems pretty relevant- are JS Conf folks notoriously anti-rust or something?
- written-beyond 11mo agoIt was a notoriously rust heavy talk, I genuinely loved it.
- lblack00 11mo agoCorrect me if I'm wrong, mlua is a set of bindings to interact with the Lua C API via FFI, not necessarily a Rust implementation. It (mlua) would be more similar to rusty_v8.
- jasonjmcghee 11mo agoindeed, not pure rust / requires vendored lib, but i thought it might help explain the potential use case
- mort96 1y agoThere'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?
- jddj 1y agoJavaScript scripting by users inside frameworks / applications built in other languages. Similar to https://github.com/dop251/goja https://github.com/dop251/goja for Go or https://github.com/sebastienros/jint https://github.com/sebastienros/jint for .NET
- Timothycquinn 1y agoThere is a Rust based browser project ongoing that can use this (if its not already).
- speps 1y agoWith 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 https://boajs.dev/benchmarks Not seeing V8, SpiderMonkey JavaScriptCore is very strange...
- mort96 1y agoIt's not competing with V8, SpiderMonkey and JavaScriptCore.
- IshKebab 1y agoWell, 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 1y agoPeople 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.
- IshKebab 1y agoWhat about people who want performance somewhere in the middle? There is clearly value in knowing the performance difference.
- mococa 1y ago[flagged]
- ComputerGuru 1y agoNice 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?
- nekevss 1y agoWe do have some interop support available in our `boa_runtime` crate (https://docs.rs/boa_runtime/latest/boa_runtime/ https://docs.rs/boa_runtime/latest/boa_runtime/) and the engine itself. Just to note, Boa is an JavaScript engine / interpreter. We're not a runtime, but we do already have some runtime features implemented in the `boa_runtime` crate, but I don't believe that includes any sandboxing as of right now. It's not even a full fledged runtime ... yet (there's been some discussion about expanding it to a full fledged runtime if anyone has a general interest to work on it). For now, `boa_runtime` is just a collection of features for users to potentially use and if they'd like to implement more, then they are totally welcome to.
- marsven_422 1y ago[dead]
- ModernMech 1y agoFeels like a better name for an embeddable Python engine written in Rust.
- k__ 1y agoAwesome! I'm always on the lookout for embeddable JS engines. How hard would it be to make Boa deterministic? Like, with seeded randomness, etc.
- jayflux 1y agoHi 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 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 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 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 1y agoDo 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
- nekevss 1y agoHi, I'm another one of the maintainers on the project. In general, we are shifting more to performance now than conformance. We currently sit at around 94% conformance, so there's not really that much more to go conformance-wise. The remaining conformance gains are a couple of the newer specification features and Intl related features. Our current conformance can be found at https://boajs.dev/conformance https://boajs.dev/conformance. Regarding performance, we are already making some gains, with hopefully more to come. The best example of this was probably the updates to script-bench-rs with our most recent release (which can be found at this commit https://github.com/khvzak/script-bench-rs/commit/d9635de77d250c49c6242b9c7fbc3e11e753f9e3 https://github.com/khvzak/script-bench-rs/commit/d9635de77d2...). We still obviously have more to improve on, but we have already made some pretty steady progress from where we were. EDIT: I forgot to answer your question about v8-jitless. Obviously in the future it would be nice to be able to be more competitive with v8-jitless, but at least for me, I'd just like to focus on improving the Boa overall.
- qbane 1y agoI 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.
- nekevss 1y agoThat may be fair. The better wording may even be specification compliant, but none of the Boa maintainers made this post (we found out about it after the fact). We, the maintainers, could probably sit down some day and try to triage the failures into a documented txt file, but the overhead on that might make it hard to maintain for an open source project. Plus a large amount of the failures are just new specification features that nobody has implemented yet.
- qbane 11mo agoI really appreciate the clear and detailed project description, the only concern is the title on HN. Failing on tests is fine, especially when it demands huge efforts to triage and reiterate on the project structure for them.
- bakkoting 11mo agoI don't think there's literally any conforming implementations of modern ECMAScript by that definition.
- qbane 11mo agoIf you mean "latest" ECMAScript then that is true. Even latest gcc or clang does not support all features from C++23: https://en.cppreference.com/w/cpp/compiler_support.html https://en.cppreference.com/w/cpp/compiler_support.html.
- esprehn 11mo agoThis project is pretty cool, but reading through the pages my biggest takeaway was how fast libjs is. Amazing work over on Ladybird. I wonder what they're doing that's so different than Boa.
- hombre_fatal 11mo agoHow endearing is it seeing multiple maintainers hop in the comments to happily answer questions? Seems like a nice team and project.
- nekevss 11mo agoThanks! It's always nice to talk and answer questions about the project!
- kitd 11mo agoFound it: https://github.com/boa-dev/boa/blob/6200e4b5eec1284b87e902c551f09154c1113fe0/core/engine/src/vm/mod.rs#L410 https://github.com/boa-dev/boa/blob/6200e4b5eec1284b87e902c5... The Boa constructor edit: I'm here all week btw
- andai 11mo agoAnd you don't seem to understand...
- globnomulous 11mo agoI'm blown away that I caught that reference.