News for hackers. Stuff that matters.
Re:Building a web application with Rust and WebAssembly by lumost on Wednesday June 15, 2022 @09:01PM (#31761415)
There are people who will write webassembly apps in Rust because it’s not JS.

Given the crates community, there are surely some special purpose apps that are easier to write in rust than JS. Heck for fun I even got pola-rs to run in the browser!

Re:Building a web application with Rust and WebAssembly by dhzhzjsbevs on Wednesday June 15, 2022 @09:53PM (#31761733)
I've yet to see a good reason for webassembly in the wild.

Is anyone using it in production for anything substantial?

We have a couple of uses of it but I'm still not convinced it was worth the trade offs and felt mor like someone was having fun with a hammer.

Re:Building a web application with Rust and WebAssembly by dmix on Wednesday June 15, 2022 @11:07PM (#31762117)
Here's the list of sites using Webassembly:

https://madewithwebassembly.com/

The use-cases are all very niche stuff... some examples:

> https://avocode.com/ much like Figma (which was written in C++) it's a heavy duty web app which involved a desktop-app like experience for working with graphical files

> Google Earth (obvious CPU-heavy non-traditional web stuff)

> various game engines and game-related stuff

> 1password uses it to "speed up their browser extension"

> PDFTron... PDF annotation app, so another Figma-like usecase

> some in-browser IDEs

So mostly it's just a) C++ type developers who don't want to learn JS for their hobby project b) it doesn't make sense for them to migrate their existing software to JS so they 'emulate' it c) it's some heavy-duty non-web-typical use-case.

I highly doubt it will ever serve a purpose beyond these niches. Which is fine... it's cool having the option but it's obviously not the first choice for any professional team targeting the web

Re:Building a web application with Rust and WebAssembly by azemetre on Wednesday June 15, 2022 @10:40PM (#31761968)
Figma uses rust heavily for their web apps utilizing web assembly. Can’t link to the exact posts but they’ve written about this on their dev blog before.

I believe it’s mostly for video processing iirc.

Re:Building a web application with Rust and WebAssembly by Klonoar on Wednesday June 15, 2022 @10:16PM (#31761850)
WASM is honestly fantastic but it took me awhile to see the benefits. Figma is the usual example.

Another good example I learned about recently is StackBlitz, which uses it to run Node in the browser for localhost-less dev environments.

Re:Building a web application with Rust and WebAssembly by yesimahuman on Wednesday June 15, 2022 @10:32PM (#31761930)
One thing about wasm I’m trying to understand: isn’t the bottleneck accessing DOM, WebGL, etc through JS? You’d have to have a workload that stayed away from those operations as much as possible to truly matter performance wise, no?
Re:Building a web application with Rust and WebAssembly by FridgeSeal on Thursday June 16, 2022 @01:06AM (#31762590)
A couple of years ago now, Mozilla had a blog post where they demonstrated that they could stream the DOM to a WASM blob and they could parse the stream, perform the diffs and updates to the DOM and stream it back, faster than the same operations could be completed in the JS runtime.
Re:Building a web application with Rust and WebAssembly by yesimahuman on Thursday June 16, 2022 @09:49AM (#31766017)
Interesting, but round trip is that still the case (i.e. performing the diffs and then applying them on the JS/DOM side)? Either way unlocking access to Web APIs from wasm will be transformational if it ever happens.
Re:Building a web application with Rust and WebAssembly by AlchemistCamp on Wednesday June 15, 2022 @10:08PM (#31761809)
Have you ever used Figma?