2 ms·
The problem with WebAssembly isn't that Nim couldn't compile to it (which it can), but that WebAssembly can't do anything without JavaScript.
by xigoi 3y ago
The problem with WebAssembly isn't that Nim couldn't compile to it (which it can), but that WebAssembly can't do anything without JavaScript.
- 0atman 3y agoWe're not talking about hypotheticals. Rust wasm is used in production now. https://developers.cloudflare.com/workers/tutorials/hello-world-rust https://developers.cloudflare.com/workers/tutorials/hello-wo... Emscripten and experimental backends hardly count as support for Nim. Python can run in webassembly by the same token, but no one would. The standard rust compiler compiles directly to webassembly, natively, with the stable toolchain. In other languages, yes, the js bridge is a problem. However, not only will this be fixed in browsers at some point, but rust is so fast that TODAY yew.rs, a mature wasm framework, is faster than react. My thoughts are better explained in this video https://youtu.be/P4LMfkFLRsI https://youtu.be/P4LMfkFLRsI
- xigoi 3y agoDoesn't Rust with WebAssembly require any JavaScript to run? If not, can you show me a webpage that uses WebAssembly and doesn't contain any JavaScript? If yes, what is the advantage over just compiling to JavaScript? > However, not only will this be fixed in browsers at some point, This has been promised for several years, and is still nowhere to be seen. > yew.rs, a mature wasm framework, is faster than react. Being faster than React is not a high bar.
- 0atman 3y agoMy apologies, it's faster than svelte, not just react: https://www.youtube.com/watch?v=4KtotxNAwME https://www.youtube.com/watch?v=4KtotxNAwME
- nicklauri 3y agoWebAssembly is not just for the web. Please take a look at wasmtime[1], wasmer[2]. It's the future of computing. You might want to read this iconic tweet[3] [1]: https://wasmtime.dev https://wasmtime.dev [2]: https://wasmer.io https://wasmer.io [3]: https://twitter.com/solomonstre/status/1111004913222324225 https://twitter.com/solomonstre/status/1111004913222324225