Hacker News new | ask | show | jobs
by jeroenhd 433 days ago
But this also runs in the browser. Using HTML and Javascript. Except now it's done slightly differently in a way that's easier for browsers to optimize, if done well.

WebAssembly and Rust may be massive overkill for most web applications, but so is React or Vue or whatever Javascript framework is popular these days. When the inevitable rewrite happens, we might as well enjoy the benefits of the new, faster-than-the-old-evolved-moloch web UI.

If anything the move from the old system (React+WebAssembly) to the new one (Rust+minimal JS+WebAssembly) will make the web application itself smaller and easier to grasp.

2 comments

They don't really use browsers. They have basically build their own react-native version, but instead of using system UI as the backend they have a backend abstraction layer with implementations for their own rendering engine or alternatively a browser on platforms that don't support WebAssembly. They only use WebAssembly rather than native because updating native code typically requires an app update via the platforms update mechanism which is slow and unreliable. It looks like the new Rust UI version just swaps out their react fork for rust code and it looks like they are dropping browser support altogether.
Rust is no panacea and rewriting a web application in Rust should not lead to any performance gains per se, unless your web application is doing number crunching in the mouse move handler. In most cases, you should be lucky to see no performance hits after a rewrite, because pleasing the borrow checker makes things unnecessarily more complicated.

A valid reason to switch to Rust should be a better developer experience, but it will require lots of upfront effort to realize the benefits. I doubt that it's worth it for small to medium-sized web applications.

Also, React itself is very much lightweight and fast, it's the developers who use it to program slow websites.