5 ms·
Asm.js is no more an open standard than PNaCl. While I'm sure others disagree, PNaCl is much cleaner in design and with more predictable performance. It's the o
by lucian1900 13y ago
Asm.js is no more an open standard than PNaCl. While I'm sure others disagree, PNaCl is much cleaner in design and with more predictable performance. It's the one I'd like to see win.
- LamaOfRuin 13y agoNot really the same. Anything that implements standard javascript will be able to run asm.js code just fine, even if they don't implement the possible optimizations. The same isn't true for NaCL.
- lucian1900 13y agoBut it'll be too slow to be useful for anything, so it's not quite so different.
- jacobparker 13y agoThat is not true. The unreal demo is usable even without the asm.js optimizations.
- migueldeicaza 13y agoJust tried it on my iPhone, and it crashed.
- jacobparker 13y agoI know for certain that there are previous non-asm.js optimized builds of Firefox that run it fine (with a performance penalty, naturally.) Chrome currently crashes because Chrome can't handle enough variables per context. This is a bug with V8 that is allegedly getting fixed. It wouldn't surprise me if mobile support is currently minimal to none though; but this is something that can and almost surely will change independent of asm.js optimization support. (And this is the Unreal demo specifically - smaller projects should be supported by virtually any modern browser* as far as I know.) * Caveats: IE doesn't support WebGL, etc.
- AndrewDucker 13y agoAsm.js at least has a specification that's not dependent on any particular implementation: http://asmjs.org/spec/latest/ http://asmjs.org/spec/latest/
- pcwalton 13y agoV8 is implementing optimizations for asm.js, as highlighted in Google I/O. (It is ignoring the "use asm" directive, though.) So there is some measure of buy-in from other browser vendors. There is also a spec for asm.js and a relatively small API footprint, making it an open standard, albeit one not (yet) sanctioned by ECMA.
- wslh 13y agoBut there is a penalty in performance with solutions like asm.js. Am I right?
- mwcampbell 13y agoasm.js is optimized for ahead-of-time verification and compilation. In this respect it's on an equal footing with PNaCl. Why would asm.js necessarily have worse performance?
- lucian1900 13y agoV8 is fixing bugs they had that caused asm.js-style JavaScript to be slower than it needs to be. I doubt they'll honour the "use asm" directive in the near future. asm.js is indeed a smaller API. I guess extreme pragmatism is what has been driving the web, but it can be argued whether that's great or terrible :(
- mwcampbell 13y ago
- wslh 13y agoI have the same hope.
- rst 13y agoasm.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.