Live data from Hacker News

Making WebAssembly a first-class language on the Web

hacks.mozilla.org

61–70 of 287 posts

Re: Making WebAssembly a first-class language on the Web

#61

The web is fascinating: we started with a seemingly insane proposition that we could let anyone run complex programs on your machine without causing profound security issues. And it turned out that this was insane: we endured 20 years of serious browser security bugs caused chiefly by JavaScript. I'm not saying it wasn't worth it, but it was also crazy. And now that we're getting close to have the right design princi…

What makes WASM execution riskier than JS?

Re: Making WebAssembly a first-class language on the Web

#62

The web is fascinating: we started with a seemingly insane proposition that we could let anyone run complex programs on your machine without causing profound security issues. And it turned out that this was insane: we endured 20 years of serious browser security bugs caused chiefly by JavaScript. I'm not saying it wasn't worth it, but it was also crazy. And now that we're getting close to have the right design princi…

I only got mad when people wanted to add browser features that clearly break sandboxing like WebUSB. How does wasm break this?

Re: Making WebAssembly a first-class language on the Web

#63
post #54

WASM with DOM support will be great. Unfortunately it will also be great for obfuscation and malware.

You can already compile malware to obfuscated asm.js. If anything, WASM blobs are easier to reverse engineer than obfuscated JS - good luck writing a ghidra plugin for JS source.

Re: Making WebAssembly a first-class language on the Web

#64

This is the right direction. Another important bit I think it’s the GC integration. Many languages such Go, C# don’t do well on wasm due the GC. They have to ship a GC as well due the lack of various GC features(I.e interior pointers)

Probably needs to be fixed by bundling runtimes for things like Go, or bringing back cross-website caching in some secure way if that's possible

Re: Making WebAssembly a first-class language on the Web

#65
post #61

The web is fascinating: we started with a seemingly insane proposition that we could let anyone run complex programs on your machine without causing profound security issues. And it turned out that this was insane: we endured 20 years of serious browser security bugs caused chiefly by JavaScript. I'm not saying it wasn't worth it, but it was also crazy. And now that we're getting close to have the right design princi…

What makes WASM execution riskier than JS?

Novelty - JS has had more time and effort spent in hardening it, across the browsers, WASM isn't as thoroughly battle-tested, so there will be novel attacks and exploits.

Re: Making WebAssembly a first-class language on the Web

#66

[flagged]

> no DOM access meant the only viable use cases were compute-heavy workloads like codecs and crypto,

no, it didn't mean that, because the overhead is not a deal breaker:

1) you don't have to do the glue code (libs can do it for you)

2) there's overhead due to glue, but the overhead is so small that WASM web frameworks easily can compete with fast JS frameworks in DOM heavy scenarios.

Source: Analysis of the creator of Leptos (a web framework based on WASM): https://www.youtube.com/watch?v=4KtotxNAwME

Re: Making WebAssembly a first-class language on the Web

#67

It's still not a great idea IMHO ;) (there was also some more recent discussion in here: https://news.ycombinator.com/item?id=47295837 ) E.g. it feels like a lot of over-engineering just to get 2x faster string marshalling, and this is only important for exactly one use case: for creating a 1:1 mapping of the DOM API to WASM. Most other web APIs are by far not as 'granular' and string heavy as the DOM. E.g. if I main…

With Google now pushing developer certification, Android and iOS practically being mandatory for certain basic functions like accessing your bank or certain government services, Webassembly would make web apps first class citizens that aren't subject to mobile operating system lockdown. Being able to complete on efficiency with native apps is an incredible example of purposeful vision driving a significant standard,…

Removing JS glue doesn't enable anything you couldn't do before. Those banks and governments still need to write the web apps, and they need to uncheck the security box which requires a hardware-attested environment.

Re: Making WebAssembly a first-class language on the Web

#68
post #61

Earlier quoted context omitted.

What makes WASM execution riskier than JS?

Novelty - JS has had more time and effort spent in hardening it, across the browsers, WASM isn't as thoroughly battle-tested, so there will be novel attacks and exploits.

On one hand, yes, new attack surface is new attack surface. But WASM has been in browsers for almost a decade now.

Re: Making WebAssembly a first-class language on the Web

#69

[flagged]

> meant the only viable use cases were compute-heavy workloads like codecs and crypto

And games, which the web is now a viable platform for a huge range of them, albeit not the top of the range, AAA and all that (yet?). Also some new graphical editors taking advantage of it, probably Figma being the most famous example so far.

Re: Making WebAssembly a first-class language on the Web

#70
post #61

Earlier quoted context omitted.

What makes WASM execution riskier than JS?

Novelty - JS has had more time and effort spent in hardening it, across the browsers, WASM isn't as thoroughly battle-tested, so there will be novel attacks and exploits.

That would be more true if WebAssembly didn't share so much sandboxing infrastructure with JS. If anything, I'd argue that WebAssembly is a much smaller surface area than JavaScript, and I think that will still be true even when DOM is directly exposed to WebAssemly.
Post reply on HN