Re:Bringing Asm.js to Chakra and Microsoft Edge
by vesinisa on Thursday May 07, 2015 @06:39PM
(#9508852)
The level of "convoluted" depends on which level you want to look at. The asm.js spec is dead-simple, almost purely "mathematical" if you like. But if you require that whatever GCC/clang would have outputted for a specific C file is the exact same binary code that gets executed in the browser, then yes - you are not getting that. But then again, asm.js just - on a high level - specifies the primitive low-level constructs that C/C++ programs employ. Mapping them to instructions is a pretty straightforward job, but of course you are not getting 100% exact same results on every browser - just like you are probably not getting 100% exact same results from clang and GCC for the same C source code.
Re:Bringing Asm.js to Chakra and Microsoft Edge
by JoshTriplett on Thursday May 07, 2015 @11:11PM
(#9509790)
It's more that I'd like browsers not doing an absurd amount of unnecessary work and overhead. Leaving aside opinions on JavaScript as a scripting language for humans, it's not a sensible intermediate format for compiled binaries. It happens to work as a (very impressive) hack.
Even if it doesn't appear to be for those who don't consider the whole context it's a reasonably effective intermediate format. The current success of it among the vendors proves that.
Re:Bringing Asm.js to Chakra and Microsoft Edge
by cwyers on Thursday May 07, 2015 @11:57PM
(#9509883)
But supporting NaCl without Pepper means no existing NaCl apps will work, so you have to somehow hope that NaCl apps without Pepper will be written.
Re:Bringing Asm.js to Chakra and Microsoft Edge
by JoshTriplett on Friday May 08, 2015 @02:47AM
(#9510312)
Have to start somewhere. In the interim, people will use it to build compatibility layers for the Pepper APIs, such as a better pepper.js (https://trypepperjs.appspot.com/).
> Secondly, it's based on a self-contained open source spec that constitutes a logical subset of another widely-supported open spec (ECMAScript) - no convoluted
I'm going to have to stop right there. asm.js is a lot of things, but "not convoluted" is certainly not one of them. asm.js involves compiling native code to JavaScript in the hopes that browsers will translate it back to some semblance of the same native code.