Live data from Hacker News

Prime Video Uses WebAssembly

amazon.science

81–90 of 254 posts

Re: Prime Video Uses WebAssembly

#81

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."

Between electron, webassembly, and other technologies, I don't think the line between web app and native app is as clear as it used to be, especially relative lift and performance. In the end, the only difference may be "one is launched in a browser and one is launched from the start menu"

Re: Prime Video Uses WebAssembly

#82
post #53

Earlier quoted context omitted.

I could be incorrect, but last time I did some reverse-engineering, Netflix had a Qt application that used native C++ bindings to knock out huge sections of that list. That Qt application was only lightly modified for each platform, IIRC, and it appeared all over the place from those cheap Linux-based Blu-ray players to Smart TV clients. Anywhere that was embedded, generally Linux-based, and unlikely to get frequent…

It all kind of undermines your original comment tho that they're trying to avoid native. It seems more likely that they're goal is to reach as many devices as they can and be able to do updates frequently. In the first paragraph of the linked article the guy says the trade-off is between "updatability and performance".

I am really sick of fast-churn and forced updates. Guys. Settle. Write a native app or three. It’ll be ok.

Re: Prime Video Uses WebAssembly

#83

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 to be consistent to each other, rather than to their host platforms. That's almost the textbook case for using a cross-platform framework.

Re: Prime Video Uses WebAssembly

#84
post #61

Earlier quoted context omitted.

Because it's not just buttons and doodads, it's all the error handling and loading indicators and UI edge cases that are needed to make it seamless and good. Title too long? Does it get truncated or shrunk? Does the UI reverse itself for RTL languages? Does the focus ring move in a sensible order? This is front end engineering. It's a whole profession, and when it's done poorly, folks think your software is garbage.…

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.

Alternatively, it could be that building high quality cross-platform front-ends that look and behave consistently across those different platforms is actually complex and the tools to solve those problems reflect that complexity. In my view, this is pretty common knowledge... just consider, every example of native software is horrible outside of one or two platforms, and most native software project/products don't even support more than two platforms.

Re: Prime Video Uses WebAssembly

#85
post #71

Earlier quoted context omitted.

How so? Your source code is still in Rust so seems like you'd still be tied to it.

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?

Re: Prime Video Uses WebAssembly

#86

Earlier quoted context omitted.

Writing a native app for every conceivable platform someone might want to watch Prime Video on seems an awful lot of work

A company that makes an awful lot of money can afford to not make an awful app on major platforms. A native app on Windows, macOS, iOS and Android (TV), and some other solution for other platforms, isn't an unreasonable ask in this context.

And when comes the payoff for writing all those native apps?

Re: Prime Video Uses WebAssembly

#87
post #61

Earlier quoted context omitted.

Because it's not just buttons and doodads, it's all the error handling and loading indicators and UI edge cases that are needed to make it seamless and good. Title too long? Does it get truncated or shrunk? Does the UI reverse itself for RTL languages? Does the focus ring move in a sensible order? This is front end engineering. It's a whole profession, and when it's done poorly, folks think your software is garbage.…

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.

Where do you think all that code lives, then? The support for dark mode, the ability to look at the pixel data of an image so that you can display text with the right color on top of it to have high enough contrast, the subtle animation when you tab between elements in a scrollable grid, the annotations for accessibility, the code that makes drag and drop work like you expect... As much as you don't think it is "hundreds of thousands of lines of code", it really is.

I started a business online five years ago. I used as little JS as possible: the first version was probably 500 lines total. Today, it's approaching a quarter million, and it's all just me. Why? Because I want forms to show helpful errors when you type the wrong thing, and my pages to show appropriate visual cues at the right time in the right places, and for the page to look right when dark mode kicks in on your laptop or you resize your window, and for decimals to be formatted correctly for folks in Europe. Or for the power users who expect things to be fast, so navigating forward and back loads and caches data correctly. Or for folks with high-dpi displays (or as it were, folks who zoom in) who don't want pixelated icons.

And has it paid off? Yeah. As an example, my service hosts a surprising majority of blind podcasters, including the American Council for the Blind. I didn't get here with a spring in my step and a strong belief in semantic HTML, I got here by investing in all the fiddly edge cases so no matter what size your screen is, the browser you use, the language you speak, the currency you want to get paid with, your ability to use a mouse, your screen reader or level of vision, you still have a great experience. As much as you'd like to call it a fad or accidental complexity, it's really just your inexperience with actually building good user interfaces in the 21st century.

Re: Prime Video Uses WebAssembly

#88

Earlier quoted context omitted.

Writing a native app for every conceivable platform someone might want to watch Prime Video on seems an awful lot of work

A company that makes an awful lot of money can afford to not make an awful app on major platforms. A native app on Windows, macOS, iOS and Android (TV), and some other solution for other platforms, isn't an unreasonable ask in this context.

If you're already very successful, why would you spend a lot more money to produce a buggier product that will generate a lot more customer support requests and cost a lot more money in engineering effort to maintain forever going forward? It just makes no business sense. This reasoning is even less justifiable in the context of WASM which is quite performant.

Re: Prime Video Uses WebAssembly

#89

Earlier quoted context omitted.

It takes an awful lot more money to ask engineers to do boring things like, “reciprocate this behaviour from iOS to Android “

Once I broached this subject with a developer at a start-up that developed totally separate native apps for iOS and Android. I queried him about the use of native apps, and he made the point that you do whatever it takes to keep your users happy. This was a startup. Not a billion dollar company. When your app is used by millions, it's a worthwhile investment. It's also hardly boring to achieve the same end result on…

“This was a startup.” And? They have the latitude to make big risks. Larger companies can’t eat that risk as easily.

“it's a worthwhile investment.” Obviously not, or you’d see it more.

Post reply on HN