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?
WebAssembly: Mozilla Won
61–70 of 375 posts
Re: WebAssembly: Mozilla Won
#62What 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?
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
#63Re: WebAssembly: Mozilla Won
#64Earlier 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, ...
Re: WebAssembly: Mozilla Won
#65I 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
#66Should 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
#67What 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
#68What 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
#69Go 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
#70It 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…