@derekdreery, have you found stdweb yet? I think its exactly what you’re after. It just recently gained support for
wasm32-unknown-unknown (before it required emscripten). It’s using a slightly different approach - the bindings are written manually using the help of an inline
js! macro, so many APIs will be missing at the moment, but its rather trivial to add the ones you need.
Or perhaps you could try and integrate your work with IDL into stdweb, so we can write new bindings more effectively. That would be awesome.
Regarding @NohatCoder’s statement on performance:
I really don’t think that performance is the only reason to use WebAssembly. Yes, it is true that accessing the DOM right now involves going through a JS FFI, but that is not always going to be the case. There is currently a proposal for GC support in WASM, which would enable direct access to web APIs. Once this is implemented, I imagine
stdweb could transition to using the new direct interface under-the-hood, whilst keeping the same API for Rust developers.
Anyway, personally I agree with @derekdreery, that the increased developer productivity from using a language such as Rust with a strong and flexible type system (eg: ADTs, traits, specialisation etc…) can be worthwhile in itself, and the ability to write both the client and server in the same language (like Node, except both languages would be Rust), is equally enticing.