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

https://news.ycombinator.com/rss Hits: 24
Summary

Boa Boa is an experimental JavaScript lexer, parser and interpreter written in Rust 馃, it has support for more than 90% of the latest ECMAScript specification. We continuously improve the conformance to keep up with the ever-evolving standard. 鈿★笍 Live Demo (WASM) Try out the engine now at the live WASM playground here! Prefer a CLI? Feel free to try out boa_cli ! 馃摝 Crates Boa currently publishes and actively maintains the following crates: boa_ast - Boa's ECMAScript Abstract Syntax Tree - Boa's ECMAScript Abstract Syntax Tree boa_cli - Boa's CLI && REPL implementation - Boa's CLI && REPL implementation boa_engine - Boa's implementation of ECMAScript builtin objects and execution - Boa's implementation of ECMAScript builtin objects and execution boa_gc - Boa's garbage collector - Boa's garbage collector boa_interner - Boa's string interner - Boa's string interner boa_parser - Boa's lexer and parser - Boa's lexer and parser boa_icu_provider - Boa's ICU4X data provider - Boa's ICU4X data provider boa_runtime - Boa's WebAPI features - Boa's WebAPI features boa_string - Boa's ECMAScript string implementation. - Boa's ECMAScript string implementation. tag_ptr - Utility library that enables a pointer to be associated with a tag of type usize . Note The Boa and boa_unicode crates are deprecated. 馃殌 Example To start using Boa simply add the boa_engine crate to your Cargo.toml : [ dependencies ] boa_engine = " 0.21.0 " Then in main.rs , copy the below: 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 ( ( ) ) } Now, all that's left to do is cargo run . Congrats! You've executed your first JavaScript code using Boa! 馃攷 Documentatio...

First seen: 2025-11-15 17:55

Last seen: 2025-11-16 17:58