Asm.js works best for compiling statically typed languages into Javascript, adding type information into the JS so that compilers can optimize around this. Some people are worried this will lead to stagnation in JS optimization for when it's written by humans (although I've seen V8 developers de-prioritize Asm.js requests in favor of other optimizations serving JS programmers).
Can't we add type inference to JS to let it be Asm.js compiled? E.g., http://www.ccs.neu.edu/home/dimvar/jstypes.html (however, this doesn't distinguish between float/double/int/long, but that doesn't seem impossible)
I don't see in the Asm.js spec that they add type info for classes/objects, but this doesn't seem too hard to infer either. You'd take an inventory of what keys and types are in objects and make a hierarchy of them for 'inheritance' of objects.
Am I missing something?
a) checks if functions/modules are eligible for asm-ifying (that is, it only uses asm.js functionality, no metaprogramming, only using asm.js "heap", do I oversee something?) b) adds a "use asm" to the function/module c) adds the correct type information d) perhaps compiles some JS functionality into asm.js (I'm thinking of the heap, which could be precompiled under certain constraints, but it's probably better to make the compiler not too smart)