3 ms·
asm.js is a well-specified subset of things that are already pretty much standardized. PNaCl adds a whole lot of new stuff that has not been subject to communi
by rst 13y ago
asm.js is a well-specified subset of things that are already pretty much standardized. PNaCl adds a whole lot of new stuff that has not been subject to community review, like (for instance) the entire input processing and rendering API. And it isn't yet clear which quirks are meant to be standard, as opposed to whatever happen to be accidents of the initial Chrome implementation.
If PNaCl were "just" coupling LLVM bytecode with some defined way of invoking existing browser APIs from within the bytecode, this would be a whole lot easier for browsers other than Chrome to support. But that's not what they're doing, or at least, not yet.
- cpleppert 13y agoPPAPI itself is a Chrome only api at the moment. I'm really concerned about using a plugin api defined by its C/C++ behavior as some kind of standard. So we not only have the DOM apis but also another class of APIs that have their own quirks. I'm not sure there is a great chance that other browser vendors will adopt LLVM, especially Microsoft. It will basically require them to not only reimplement the native compiler but also the frontend that compiles to LLVM bytecode and any additional SDK tools like a debugger. Asm.js is a lot easier to implement on every level. It will be served compressed so there wont be a lot of size overhead compared to a bytecode format. If you just use asm.js to call into webGL or audio apis there shouldn't be any big performance difference over using something lower level like PNaCL. Additionally, different browsers may use different optimizations when compiling LLVM code, differing implementations will give different performance characteristics. PNacl is no different than asm.js in requiring that the compiler be optimized.