I have the Rust/Wasi HQ9+ example running in a WasmerJS Svelte app and can access the same wasmFS filesystem with both. All good so far.
What I want to do now is be able to expose APIs from Rust to the app JavaScript and vice versa. I've been trying to do this with wasm-bindgen, and did manage to expose a function in the wasi `instance.exports` in addition to the Rust `main()` but my changes also cause an error, and I don't know how to call the function anyway. I was trying to combine the WasmerJS style with the wasm-bindgen style described in this article (
https://hacks.mozilla.org/2018/04/javascript-to-rust-and-back-again-a-wasm-bindgen-tale/) but I don't know what I'm doing.
Does anyone know how to go about this or have a WasmerJS example which does more than call the `main()` of a WASI backend? It doesn't have to be Rust, although that would be best obvs.
I'd also like to be able to make calls from the Rust back to the JS app.
Thanks.
--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/aefbec4f-4e27-4807-ba13-445365c8cb17n%40googlegroups.com.