2 ms·
Let me throw Nim into the mix and say that it has had a JS backend for years now. It's officially supported so it's very stable. Native WASM support isn't ther
by dom96 9y ago
Let me throw Nim into the mix and say that it has had a JS backend for years now. It's officially supported so it's very stable.
Native WASM support isn't there yet, but if you want extra speed you could combine Nim's JS backend and Nim's C backend + emscripten to compile to WASM. You can see this approach in action in a game called Reel Valley [1][2]. The advantage is that you can access the DOM from Nim using the JS backend (you cannot do that in WASM yet AFAIK).
1 - https://www.youtube.com/watch?v=DmMOIVUeUrE https://www.youtube.com/watch?v=DmMOIVUeUrE
2 - https://www.facebook.com/reelvalley/ https://www.facebook.com/reelvalley/
- steveklabnik 9y agoTo be clear, Rust has also had support for asm.js and wasm via emscripten for quite a while. We're very enthusiastic about the new LLVM backend though, as it allows for significantly more control, including file size. > (you cannot do that in WASM yet AFAIK) wasm can do anything JS can by calling out to JS. What people mean when they ask for "DOM support in WASM" is to have it be direct, skipping the need for the JS call. https://crates.io/crates/stdweb https://crates.io/crates/stdweb is an example of using WASM to manipulate the DOM through JS in Rust today.