Re:Rust's 2018 roadmap
by steveklabnik on Monday March 12, 2018 @02:27PM
(#16570242)
To 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 is an example of using WASM to manipulate the DOM through JS in Rust today.
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
2 - https://www.facebook.com/reelvalley/