You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to Rust, and I was wondering how hard it would be to compile this into WebAssembly for usage with Node.js / browsers. I tried briefly using wasm-pack build (after adding crate-type = ["cdylib"] to Cargo.toml) and it just spit out a bunch of errors. I'm not experience enough to know whether this is relatively easy with a little bit more configuration or if it would require rewriting code.
Any feedback / help is appreciated.
The text was updated successfully, but these errors were encountered:
After some more investigation, it seems that the main blocker on this is the fact that raw TCP sockets are used (which are supported in Node.js but not the browser).
If you want to run it in a browser, it might be possible to use Emcripten which polyfills sockets to web sockets. You'd also then need something like websockify on a server.
In theory it should be possible to run on Node.js using network calls from WASI but I'm not sure if WASM compilers work with that yet. This is a very rapidly changing space.
So TL;DR is that if you want Node.js support it looks like it might be easiest to just re-implement in JS.
I'm new to Rust, and I was wondering how hard it would be to compile this into WebAssembly for usage with Node.js / browsers. I tried briefly using
wasm-pack build
(after addingcrate-type = ["cdylib"]
to Cargo.toml) and it just spit out a bunch of errors. I'm not experience enough to know whether this is relatively easy with a little bit more configuration or if it would require rewriting code.Any feedback / help is appreciated.
The text was updated successfully, but these errors were encountered: