breadboard-ai / breadboard

A library for prototyping generative AI applications.
Apache License 2.0
175 stars 23 forks source link

Convert `runJavascript` to use QuickJS #3462

Open dglazkov opened 2 days ago

dglazkov commented 2 days ago

See https://github.com/justjake/quickjs-emscripten

surma commented 23 hours ago

I would heartily recommend going with rquickjs instead. Compiles really well to Wasm, and Amazon’s llrt has all kinds of plugins to provide the standard globals like TextEncoder, crypto.subtle etc

dglazkov commented 21 hours ago

OOoooooh. How do I take a rust crate and turn it into an npm package?

dglazkov commented 20 hours ago

https://developer.mozilla.org/en-US/docs/WebAssembly/Rust_to_Wasm

surma commented 4 hours ago

Easiest way: wasm-pack. It even generates a package.json and stuff.

And for all the low-level questions and needs you might have about compiling Rust to WebAssembly, I'll shamelessly self-plug my blog post.