Live data from Hacker News

Rust and WebAssembly in 2019

fitzgeraldnick.com

31–40 of 97 posts

Re: Rust and WebAssembly in 2019

#32
I'm really excited and happy about the direction Rust has gone with WASM; and this is coming from someone who has never used Rust before.

I like JS, a lot, but my hope with WASM was still pretty much literally what they're talking about here -- that languages would start to do first-class replacements for Javascript. I didn't want people to create massive binary blobs that were primarily just native code that rendered everything out to Canvas as an afterthought. In contrast, Rust is building out better host bindings, web-first tools, looking into fallbacks for older browsers like IE11...

Nearly every time I read an article about Rust and WASM I feel happy and hopeful. I think the work Rust has done here has been ridiculously valuable for setting a tone and a standard for what WASM-targetting languages should be.

As a result, Rust is pretty high up on my list of languages that I'm interested in learning in the future, because I feel like any community that is getting this much right on the web has probably also gotten other things right with the core language. The fact that it's increasingly looking likely that Rust on the web will probably be one of the best supported, most thoughtful alternatives to Javascript out there makes it even more attractive.

Re: Rust and WebAssembly in 2019

#34

Is there any work done towards enabling Rust + WASM without any JS/npm?

If you mean producing a wasm module without touching third-party tooling, then this can already be done with Rust today.

The standard rust compiler is capable of cross-compiling out of the box, so the only thing you need in order to produce a working wasm module are the standard libraries which can be obtained from rust-lang.org.

I wrote a somewhat detailed guide about the process here: https://www.reddit.com/r/rust/comments/9t95fd/howto_setting_...

Re: Rust and WebAssembly in 2019

#35
post #26
post #15

Earlier quoted context omitted.

> As I understand it, there's no current plans for WebAssembly to include a garbage collector There are plans to add a garbage collector. See https://hacks.mozilla.org/2018/10/webassemblys-post-mvp-futu... . But meanwhile, Webassembly is mainly just for C and Rust.

> Webassembly is mainly just for C and Rust That's absolutely incorrect. Go and .NET can target WASM for quite a while now. Microsoft's Blazor is specially interesting. Their FlightFinder demo written in pure C# renders a beautiful app: https://i.imgur.com/HHFkB1E.png Code here: https://github.com/aspnet/samples/tree/master/samples/aspnet...

Right but those languages compile in their own garbage collector. That's not the same as a VM provided garbage collector, and furthermore, the GC used in browsers also manages DOM allocations, and thus directly interfacing the DOM without JS is impossible until the VM GC is implemented.
Post reply on HN