Asm.js: The JavaScript Compile Target

  • Where everyone seems to be focused on performance, it strikes me that performance is just the flip side of efficiency, and that asm.js might be a great way to stretch battery life on mobile. Will asm.js web pages run with less power than traditional JS? Also I suspect this can help with the sluggish performance of mobile browsers in general.

  • This is the first I've heard of Portable Native Client (PNaCl), which sounds very interesting.

    I think ASM is a great idea for "hacking", but the thing that doesn't make a lot of sense to me, is that you're usually only going to bother compiling to ASM for things which need the performance. The idea that they'll "still work" in non-optimized browsers doesn't seem too convincing -- games would probably be unplayable, and you'd see messages saying "This game only supports Firefox" etc.

    And I don't see there being that many things written in C, etc., that one would want to port to the web, that aren't particularly processor-intensive.

    Presumably PNaCl would be close to native code speed, a big improvement over ASM. And it seems like what's needed is cross-platform fast execution -- not backwards compatibility with JavaScript that will still run, but run much more slowly.

    But nevertheless, it's super-interesting watching what's going on with ASM.

  • This post is fundamental to understand the ins and outs of Asm.js this was really helpful. It deserves its summary to make it even more understandable! http://tldr.io/tldrs/515c59e49ac882db1600010b/asm-js-the-jav...

    Asm.js's support should make sense for Chrome OS no?

  • Unimpressed by the "Unreal" demo. Just a simple scene flyover, no dynamic lights or scenario, characters, particle effects etc. etc. I bet one can put together a demo of similar quality with vanilla JS and WebGL.

  • John Resig's blog posts never fail to impress.

    The bit comparing Asm.js to Google's Native Client is interesting.

  • I think it's really great of a man who has some very high stakes in traditional Javascript to be so open to Asm.js; I fully expected to read some passive-aggressive dismissal.

  • Does anyone know how hard it would be to port an h264 decoder to asm.js? If it worked, it could be used to shim h264 support into Firefox.

  • In theory, would it be possible to take an ActiveX or NPAPI plugin and compile it down to asm.js-compatible javascript?

  • As a node developer, I'm curious to know what if anything asm.js can do for node? Maybe I'm misunderstanding something, but wouldn't asm.js allow basically all of node's core to be written in JavaScript itself, rather than in C/++? I think that would be a tremendous advantage, but maybe I'm missing part of the picture...

  • I'm surprised the list of Emscripten projects does not contain a linear algebra library. Is that because all the common matrix transforms can already be offloaded to native browser APIs?

    https://github.com/kripken/emscripten/wiki

  • Why are C/C++ so much faster than JIT'ed Javascript? Can't a subset of Javascript be converted to ASM.js JS that'll run around the same speed? loops, arrays, conditional statements, etc. Why does Javascript have to be so much slower?

  • Here's how to think of it. Right now, JavaScript is the best compiler target on the web. It's far from perfect, but it works. Asm.js makes it a better compiler target.

  • Wow, Mozilla is making a really big marketing push for asm.js.