breadboard icon indicating copy to clipboard operation
breadboard copied to clipboard

Convert `runJavascript` to use QuickJS

Open dglazkov opened this issue 1 year ago • 5 comments

  • [ ] Hack something together quickly to see what breaks

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

dglazkov avatar Oct 10 '24 00:10 dglazkov

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

surma avatar Oct 11 '24 14:10 surma

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

dglazkov avatar Oct 11 '24 15:10 dglazkov

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

dglazkov avatar Oct 11 '24 16:10 dglazkov

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.

surma avatar Oct 12 '24 08:10 surma

Thank you so much. At this point, my next step is to get something together very quickly to run existing runJavascript configs through and see what breaks.

dglazkov avatar Oct 12 '24 17:10 dglazkov