Hacker News new | ask | show | jobs
by badlibrarian 435 days ago
Runs great on an underpowered Roku in HTML and JavaScript. But I guess why not. Developers gotta developer.

My main issue is having to buy my parents a bigger TV every few years because the fonts keep getting smaller and their eyes keep getting worse.

3 comments

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.

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.

I have tested the reactivity difference between the current UI and the Rust rewrite and it is staggeringly faster, this is not just a dumb pet project.
Just to make sure we're on the same page here, this is the app that lets me move a highlighted rectangle using a controller with 300ms latency to select the next episode of Reacher, right?
Yes, and the difference is incredible. It leads to a much less frustrating experience when navigating around the app overall.
Perhaps we might ask not just how the new version is so fast, but why is the old version so slow.
> why is the old version so slow

In my experience of building consumer web applications, they all start fast.

Then someone says “We need to track every interaction in mixpanel. What’s even the point if we don’t know it happened”.

Then the sales team says “We need to track in Salesforce, nobody on our team looks at mixpanel”

Then the marketing team goes “We must consolidate in google analytics, nothing else fits our usecase”

Then the other product team says “We need Amplitude”

Then the re-engagement marketing team goes “Braze for us please, we must know when customers do a thing so we can trigger campaigns”

Then the product growth hacker marketing team says “Our recommendation engine needs to use the custom in-house framework so we can train our models”

Then someone goes “Hey it looks like we’re losing events sometimes, you have to make sure users don’t leave the screen until all events are submitted”

Then someone has a cool idea: “Wow it would be great if we could see where users are looking with something like Hotjar”

And now you have an app where every interaction triggers 20 different trackers, waits for all of them to settle, then reacts to your action. Just look at the AWS homepage one day – I once counted 70 requests blocked by Brave’s built-in blockers before I even moved my mouse. It’s slightly better after login – only a dozen or so tracker requests iirc.

And all throughout this engineering is saying "this is stupid, the app shouldn't know or care about those systems directly, it should offload the messages to some other service to handle" and yet management says "no time for silly things like basic software engineering, we need to move fast [and break things]"
Sure and whoever planned and implemented all of this in a cludgy blocking way is innocent angel in this scenario.

case in point, AWS homepage is miles ahead any smart tv menu and I doubt they write it in rust.

Native apps queue up these requests on low priority threads that only execute when the system is idle. I guess that’s not a thing on the web? Genuinely curious, I’m not a web guy
Good question which is in large part answered in the linked article / talk.
I wouldn't trust anyone saying that a Roku "runs great" in any fashion. This is the slowest piece of sh* hardware I ever had the displeasure to use, the waiting times when switching apps are insane. Typing was a dreaded galore, I would plug my laptop over hdmi whenever I could instead. Every interaction in such a device should always be 100% less-than-a-frame instantaneous.
Not sure loading megabytes of Rust-transpiled webassembly is going to speed up those app switching times, but I feel your pain. As a Roku dev there are many hardware variants. Roku requires you to support the ancient ones. It sucks.