Live data from Hacker News

Prime Video Uses WebAssembly

amazon.science

101–110 of 254 posts

Re: Prime Video Uses WebAssembly

#101
post #52

The egui framework they mention is pretty neat: https://emilk.github.io/egui/ It an entirely custom toolkit, so don't expect it to have a native look and feel, but it's a GPU-first design with multiple back-ends. It can be used in native OpenGL apps too. It's an immediate-mode UI, so it's very easy to build and update even complex windows. Great choice if you want to prototype a game.

> we built an application that overlays debugger information on an application scene render using egui, a Rust GUI library

This is the context. They use egui to display debugger information - performance does not matter for the debugger information.

Re: Prime Video Uses WebAssembly

#102
post #71

Earlier quoted context omitted.

The source code is in Rust. But the compilation target is WASM instruction set.

Why does that matter with respect to being less tied to rust? Yes, it compiles to WASM but your engineers still have to write rust in order to make changes to the software. I mean I suppose they could edit the WASM directly since it's technically human readable, but if you're doing that why bother with rust at all?

In terms of platform support - if you target a VM you don’t have to worry about moving from Rust because another language might not support that runtime. Now any language that can work on a WASM VM is okay. Also, if the app isn’t monolithic it means supporting services can be in other languages than Rust too.

Re: Prime Video Uses WebAssembly

#103
post #73

Prime Video app sucks. Spend less time over-optimizing, more time improving usability.

It is the worst of the major streaming apps. It's very slow and has lots of loading/reloading on every piece of hardware I've used it on (Android phone, iPad, AppleTV, AndroidTV). I imagine the other streaming apps use similar techniques to share code, so I wonder why theirs is so poor in this regard. Outside of the major players though it gets a lot worse - Funimation's streaming app is horrendous, as is Crunchyroll…

But Amazon is one of the largest companies in the world - Crunchyroll has an excuse. Amazon doesn’t.

My girlfriend’s smart TV runs WebOS and if we have to use Prime for some reason it’s easier to plug the laptop in via HDMI and do it via a browser. Amazon’s app seems to just be broken on WebOS there.

Not only that, but what the heck is up with the completely uninspired UI and user-hostile UX? The importance of seasons being lumped together is something a focus group should have noticed.

Amazon was a web-first company - you really have to wonder how they screwed up their user experience so, so badly.

Re: Prime Video Uses WebAssembly

#104
post #80
post #61

Earlier quoted context omitted.

Frontend engineering is a thing because of the accidental complexity of a massive software stack that's evolved by accretion and gone through fad after fad after fad. I'm not looking down on frontend engineers, but I don't believe right-to-left languages or focus order inevitably leads to hundreds of thousands of lines of code or 50+ MB binaries.

> don't believe right-to-left languages or focus order inevitably leads to hundreds of thousands of lines of code or 50+ MB binaries It does. It literally does. Try writing your own operating system, or font parser, or graphics engine. The work our shitty React apps sit on top of is unimaginably complex. It would take centuries for one single person to grasp what is going on in an iOS "Hello World" app. It's not simp…

> For reference, vim

Vim is an incredibly useful tool but I've seen frequent complaints about its codebase. Competitors with significantly higher code quality exist (ex Kakoune).

> > don't believe ... inevitably leads to

> It does. It literally does. Try writing your own operating system, or font parser, or graphics engine.

There are working examples of such and the code appears to be significantly simpler than the status quo. I'm far from an expert here but to the best of my understanding feature creep combined with maintaining backwards compatibility is to blame for a significant amount of current complexity.

Consider that if you rewrite a low level API with the benefit of hindsight, everything that uses that API has to be updated. Often multiple distinct APIs will be involved though, not just one. Look at the difficulty the Linux ecosystem has had gaining full support for Wayland, which necessitated the likes of PipeWire and a number of other new ways of doing things, and has been "nearly ready" for production for how many years now?

Re: Prime Video Uses WebAssembly

#105
post #28
post #19

Earlier quoted context omitted.

There is a cross sectional problem between what codecs that specific hardware supports (and generally is supported by all the popular devices), how much bandwidth you have on your connection and how many different codecs the various streaming services can support and cache locally. There are trade offs to be made.

Didn't everyone agree to align on AV1? So that should become a non issue as its adoption progresses.

>Didn't everyone agree to align on AV1?

Not that I am aware of. I have more faith in that with AV2.

Re: Prime Video Uses WebAssembly

#106
post #80

Earlier quoted context omitted.

> don't believe right-to-left languages or focus order inevitably leads to hundreds of thousands of lines of code or 50+ MB binaries It does. It literally does. Try writing your own operating system, or font parser, or graphics engine. The work our shitty React apps sit on top of is unimaginably complex. It would take centuries for one single person to grasp what is going on in an iOS "Hello World" app. It's not simp…

> For reference, vim Vim is an incredibly useful tool but I've seen frequent complaints about its codebase. Competitors with significantly higher code quality exist (ex Kakoune). > > don't believe ... inevitably leads to > It does. It literally does. Try writing your own operating system, or font parser, or graphics engine. There are working examples of such and the code appears to be significantly simpler than the s…

> There are working examples of such and the code appears to be significantly simpler than the status quo

Status quo is bloated -> someone rewrites a simple replacement -> becomes popular -> "Can you cover this reasonable use case, it's not currently supported" -> repeated previous step several hundred times -> oh fuck, the "lightweight" rewrite has become the bloated status quo -> GOTO step one

Re: Prime Video Uses WebAssembly

#107
On systems such as iOS which you don't have JIT, performance is going to be real bad, as if you are dancing with a pair of iron made shoes. Honestly Amazon should afford going full native, at least for the scene and animation stuff.

Re: Prime Video Uses WebAssembly

#108
post #33

Earlier quoted context omitted.

That's why I said as it's being adopted. Right now it's just the very beginning of this phase (for instance AMD just started providing hardware decode in RDNA2). So I expect this to become a non issue at some point .

As long as they don't take it as an excuse to reduce bitrates further. It's getting pretty bad these days with macro-blocking everywhere. This practice really took off when covid started. I actually cancelled Netflix because of it. Amazon is not as bad for macroblocks, but I have run into a few shows that show macroblocks, such as Mr. Robot.

>As long as they don't take it as an excuse to reduce bitrates further.

I actually think it is easier ( comparatively speaking ) to push for improved Networking so someday bitrate becomes less of a concern. Just like what happened with Audio. Even with the state of the art VVC Encoder, you only get about 65% ( or 2.8x ) reduction in bitrate in most common cases compared to x264. 65% reduction in 20 years isn't exactly a lot. We have easily got 20x bandwidth reduction in cost in the past 20 years.

Netflix are testing with 800Gbps per box now. May be when PCI-E 5.0 is available along with higher memory bandwidth they could try 1.6Tbps per box within the this decade.

Re: Prime Video Uses WebAssembly

#109

Personally, to me , whenever I read these stories about how Amazon is doing this novel use of WebAssembly, or how Uber is doing ludicrous engineering effort to keep their React-based app under 300MB for the App Store, I can't help but think: "Man, that's an awful lot of work to avoid writing a native app."

Uber is a bad example because they need to have support for literally every payment method on the planet. And all of that needs to be preloaded ahead of time just in case the user decides they're going to fly to Mumbai tomorrow. Their app absolutely needs to be bloated or it won't work at all. Likewise, Amazon needs to run on all sorts of different smart TV platforms, not just iOS and Android. All of those apps need…

>And all of that needs to be preloaded ahead of time just in case the user decides they're going to fly to Mumbai tomorrow.

This is Interesting. So essentially Uber is a "Global" App by default?

Post reply on HN