Possible to compile just the engine? #2163
-
Is it possible to strip boa down to just the engine, i.e. without WASM, CLI, profiler, tester, etc? I want to try compiling it for use in a C program. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
However, we currently don't offer a compatibility layer with C, so you'll need to generate your own bindings by hand or by using |
Beta Was this translation helpful? Give feedback.
-
For my case, I am trying to embed boa into my rust app after reading the blog "Adding a JavaScript interpreter to your Rust project". After some quick tests, I realize it's really useful and even better if it's size can be smaller. Example: let mut context = boa_engine::Context::default();
let res = context.eval("1+1").unwrap(); let context = quick_js::Context::new().unwrap();
let res = context.eval("1+1").unwrap(); boa: 10.9 MB |
Beta Was this translation helpful? Give feedback.
cargo build -p boa_engine
should generate a usable dynamic library of the pure engine.However, we currently don't offer a compatibility layer with C, so you'll need to generate your own bindings by hand or by using
cbindgen
.