Live data from Hacker News

WebAssembly: Mozilla Won

robert.ocallahan.org

61–70 of 375 posts

Re: WebAssembly: Mozilla Won

#61
post #56

What are the main benefits of WebAssembly over asm.js? I understand that asm.js was a subset of JavaScript that allowed the compiler to create faster code. For example because it could be sure that variable types do not change during runtime. But what do we gain with WebAssembly? Faster download+compilation times? How much faster?

Yes, faster load times. Also, a more sensible target language.

Re: WebAssembly: Mozilla Won

#62
post #56

What are the main benefits of WebAssembly over asm.js? I understand that asm.js was a subset of JavaScript that allowed the compiler to create faster code. For example because it could be sure that variable types do not change during runtime. But what do we gain with WebAssembly? Faster download+compilation times? How much faster?

A lot.

There's a talk by Alex Danilo from Google IO 17 explaining it in detail.

Here, I'll link you directly to the part where he starts explaining the differences on a technical level:

https://www.youtube.com/watch?v=6v4E6oksar0&t=11m24s

Another part is that I suspect it makes maintaining a good JS compiler easier, because all of that asm.js code can be removed. I'm sure the browser vendors are happy about that.

Re: WebAssembly: Mozilla Won

#64
post #58

Earlier quoted context omitted.

yes, but the API you'll code against is limited

That's not really true. With JS glue code (including many libraries already written) Wasm modules can access anything JS can do. E.g. there are Wasm demos showing access to WebGL2, audio generation, camera/microphone, HTTP, storage, gamepads, ...

You have the full Web API, yes, but it's limited compared to native, although sure, it's nonetheless very capable.

Re: WebAssembly: Mozilla Won

#65
post #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.

Well, DirectX fostered multiple generations of gaming on Windows.

Re: WebAssembly: Mozilla Won

#66
WebAssembly and PNaCL always seemed like a hack. A very elegant thought-out hack, but still a hack. It required a 64 bit OS but could only ever operate in 32 bit space.

Should have been dead on arrival because of that fact alone. For something that was trying to bring C/C++ and video games into a browser setting a 4GB max on memory should have been a non-starter.

Re: WebAssembly: Mozilla Won

#67
post #56

What are the main benefits of WebAssembly over asm.js? I understand that asm.js was a subset of JavaScript that allowed the compiler to create faster code. For example because it could be sure that variable types do not change during runtime. But what do we gain with WebAssembly? Faster download+compilation times? How much faster?

A lot. There's a talk by Alex Danilo from Google IO 17 explaining it in detail. Here, I'll link you directly to the part where he starts explaining the differences on a technical level: https://www.youtube.com/watch?v=6v4E6oksar0&t=11m24s Another part is that I suspect it makes maintaining a good JS compiler easier, because all of that asm.js code can be removed. I'm sure the browser vendors are happy about that.

I don't mean the technical differences. I mean the benefit. What will be the gain for the user of a web app?

Re: WebAssembly: Mozilla Won

#68
post #56

What are the main benefits of WebAssembly over asm.js? I understand that asm.js was a subset of JavaScript that allowed the compiler to create faster code. For example because it could be sure that variable types do not change during runtime. But what do we gain with WebAssembly? Faster download+compilation times? How much faster?

Yes, faster load times. Also, a more sensible target language.

How much faster? I would think gzip should even out most of the difference between a text based and a byte based code.

Re: WebAssembly: Mozilla Won

#69
It seems there is this effort to get C/C++ code performing fast inside of a browser... then at the same time there seems to be an effort to get people to stop coding in C/C++ altogether and switch to something more memory safe.

Go or Rust for example. Also, I watched a talk from DConf and saw that D is adding memory safety as well. You need to mark any part of code doing pointer arithmetic as "system code" or something like that.

I think it's a shame one couldn't have happened before the other. I wish something like D or Go or Nim or something else would have won. Then there would be this effort to get that language fast on the browser.

Is anything I'm saying making sense? I don't know enough about WebAsm, is it really tied tightly to C or could Go or Rust or some future version of statically typed Python become a first-class citizen?

Re: WebAssembly: Mozilla Won

#70

It seems there is this effort to get C/C++ code performing fast inside of a browser... then at the same time there seems to be an effort to get people to stop coding in C/C++ altogether and switch to something more memory safe. Go or Rust for example. Also, I watched a talk from DConf and saw that D is adding memory safety as well. You need to mark any part of code doing pointer arithmetic as "system code" or somethi…

Rust already can compile to WebAssembly. WebAssembly is in no way tied to C, not at all.
Post reply on HN