Live data from Hacker News

WebAssembly: Mozilla Won

robert.ocallahan.org

31–40 of 375 posts

Re: WebAssembly: Mozilla Won

#32
post #13

Earlier quoted context omitted.

I don't really understand what "the compiler is trusted" means. What could an evil compiler really do? Maybe add a spinning loop to waste CPU cycles, but that can be done in JS too.

Both PNaCl and WebAssembly need a compiler to a get the machine code run by CPU, but the output of PNaCl is checked via NaCl verifier while nothing checks that the output of WebAssembly is safe machine code. As the verifier for NaCl is likely to be an order magnitude smaller than a component in WebAssembly implementation that verifies and compiles the bytecode to the native code, PNaCl attack surface is much smaller.

>nothing checks that the output of WebAssembly is safe machine code.

The JS/WASM VM does. If unsafe WASM code is allowed to execute, there is a bug in VM. VM must prevent semantically incorrect WASM from executing Control flow integrity and incorrect use of pointers are detected at load time. There are traps for invalid indexes, exceeding stack limits, invalid indexes in the index space.

Re: WebAssembly: Mozilla Won

#33
post #19
post #17

I don't really like the headline. I don't want Mozilla to "win", and I don't think Mozilla wants to either; I want the open web to flourish. That said, the article is very informative, and well-balanced. It was really good of Google and the other browsers to join the wasm bandwagon. And yes, although as the author himself points out, "proclaiming a "winner" is unimportant or even counterproductive", Mozilla does dese…

Potentially the article title is a reference to a story that was posted a few days ago called, Chrome Won .

Funny enough, when I googled 'Chrome Won' the first result was "Repair Chrome if it crashes or won't open" https://support.google.com/chrome/answer/142063

Re: WebAssembly: Mozilla Won

#34
post #3

I think this is a good thing. It probably prevented a new DirectX style dark age of the web. Probably! I don't pretend to be able predict what path companies would have went in the next few years. It's really good to see that there is a will to agree and that there is more than one player. Could always be more, also for keeping standards sane. (WebSQL officially failed because there isn't more variety)

DirectX fostered multiple generations of gaming on PCs. I dunno what you're talking about with referencing it in a web development context, but it was, and still is, miles ahead of dicking around with broken OpenGL.

Re: WebAssembly: Mozilla Won

#36
post #13

Earlier quoted context omitted.

I don't really understand what "the compiler is trusted" means. What could an evil compiler really do? Maybe add a spinning loop to waste CPU cycles, but that can be done in JS too.

Both PNaCl and WebAssembly need a compiler to a get the machine code run by CPU, but the output of PNaCl is checked via NaCl verifier while nothing checks that the output of WebAssembly is safe machine code. As the verifier for NaCl is likely to be an order magnitude smaller than a component in WebAssembly implementation that verifies and compiles the bytecode to the native code, PNaCl attack surface is much smaller.

> nothing checks that the output of WebAssembly is safe machine code

By this line of reasoning, “nothing checks that the output of the JavaScript compiler is safe machine code”. Because that is essentially what WebAssembly is: like asm.js, it's just another kind of input to your JS VM.

And… well, you're right. It's the JIT's job to produce sensible code, and it's the browser's job to sandbox that well.

But what's wrong with that?

At least with WebAssembly it's a well-defined, small language that's easy to verify.

Re: WebAssembly: Mozilla Won

#37
post #24

Is WASM platform independent?

To the extent that asm.js and JavaScript are, yes. Everything is well-defined, so in theory any Turing machine should be able to run it, but it's certainly going to be easier to implement efficiently on a typical modern 32-bit or 64-bit CPU in a computer or phone than on something more unusual.

Re: WebAssembly: Mozilla Won

#38
post #17

I don't really like the headline. I don't want Mozilla to "win", and I don't think Mozilla wants to either; I want the open web to flourish. That said, the article is very informative, and well-balanced. It was really good of Google and the other browsers to join the wasm bandwagon. And yes, although as the author himself points out, "proclaiming a "winner" is unimportant or even counterproductive", Mozilla does dese…

It is joke - we had 'Chrome won' the other day. There is a hidden point being made which you would probably agree with.

i hate how HN now has titles that require knowing previous posts to understand.

That's the domain of reddit.

Re: WebAssembly: Mozilla Won

#39
post #13

Earlier quoted context omitted.

Both PNaCl and WebAssembly need a compiler to a get the machine code run by CPU, but the output of PNaCl is checked via NaCl verifier while nothing checks that the output of WebAssembly is safe machine code. As the verifier for NaCl is likely to be an order magnitude smaller than a component in WebAssembly implementation that verifies and compiles the bytecode to the native code, PNaCl attack surface is much smaller.

>nothing checks that the output of WebAssembly is safe machine code. The JS/WASM VM does. If unsafe WASM code is allowed to execute, there is a bug in VM. VM must prevent semantically incorrect WASM from executing Control flow integrity and incorrect use of pointers are detected at load time. There are traps for invalid indexes, exceeding stack limits, invalid indexes in the index space.

This is not about unsafe WASM which should be rejected by verifier. This is about the raw machine output that the compiler generates from WASM. As with JIT for JS currently nothing verifies WASM compiler output. So a bug in the compiler may result in a WASM that passes the verifier to be translated into unsafe machine code.

Re: WebAssembly: Mozilla Won

#40
post #17

I don't really like the headline. I don't want Mozilla to "win", and I don't think Mozilla wants to either; I want the open web to flourish. That said, the article is very informative, and well-balanced. It was really good of Google and the other browsers to join the wasm bandwagon. And yes, although as the author himself points out, "proclaiming a "winner" is unimportant or even counterproductive", Mozilla does dese…

It is joke - we had 'Chrome won' the other day. There is a hidden point being made which you would probably agree with.

Also written by an (Ex-)Mozillian. Seems like wondering about Firefox's place in the world is currently top-of-mind there :-(
Post reply on HN