News for hackers. Stuff that matters.
Re:Four Years of Rust by apo on Wednesday May 15, 2019 @11:22AM (#19920307)
> Rust+WASM went from an experiment to a usable product, making rustc the first compiler with focus on supporting WASM

This may be the most interesting use case of them all. WebAssembly is fast, but it's also not fun to write. There are languages like AssemblyScript and Lys that will let you write WebAssembly in what appears to be a higher-level language, but you're still schlepping bytes around and must build the entire universe yourself.

Rust offers an alternative: a high-level language with readily accessible tooling to easily switch compile targets from native to wasm.

Given that so many JavaScript frameworks now require a compile step, the fact that Rust is compiled is barely a disadvantage.

Not only that, but any general-purpose library code you write to support your web application can be redistributed as native binaries for use in C/C++/Python/Ruby/etc. projects.

Although the original idea for such a universal web/native target, Java, died from self-inflicted wounds, the underlying need for a way to deploy code across all platforms, native and web, never went away. Rust+wasm is a solution that works today.

There's something else as well. WebAssembly is a sandboxed runtime, meaning it runs in its own little environment. Anything it knows about the outside is an opt-in add-on.

This makes wasm an interesting target for systems in which the JVM is currently used. For example, database extension environments and web servers.

Re:Four Years of Rust by pjmlp on Thursday May 16, 2019 @12:48AM (#19926211)
Java wasn't the original idea, Pascal P-Code from UCSD was it, among several other ones.
Re:Four Years of Rust by setr on Wednesday May 15, 2019 @11:35AM (#19920437)
Curious: if you rip out the js runtime in favor of pure webassembly, does that have a significant impact on electron viability?

Obviously only once webassembly can do the full job

Re:Four Years of Rust by MuffinFlavored on Wednesday May 15, 2019 @12:27PM (#19921010)
WebAssembly can't touch the DOM without JavaScript. Does that change your question?
Re:Four Years of Rust by steveklabnik on Wednesday May 15, 2019 @12:28PM (#19921026)
... for now. We've built the Rust/Wasm story such that once wasm gains that ability, your code gets upgraded internally, with no API changes. You're already ready for the future!
Re:Four Years of Rust by Animats on Wednesday May 15, 2019 @04:56PM (#19923687)
WebAssembly can't touch the DOM without JavaScript.

There's still hope for ad-blocking, then.

Re:Four Years of Rust by pjmlp on Thursday May 16, 2019 @12:49AM (#19926217)
Not really, there is Canvas & WebGL, and DOM support is coming anyway.
Re:Four Years of Rust by wbl on Wednesday May 15, 2019 @09:18PM (#19925323)
I'm curious what you think those wounds were.