4 ms·
Are you proposing a JS to JS filter that a) checks if functions/modules are eligible for asm-ifying (that is, it only uses asm.js functionality, no metaprogram
by llogiq 13y ago
Are you proposing a JS to JS filter that
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)
- logn 13y agoGenerally, yes. Granted, I don't know the specific details of this. I'm just a JS programmer, not familiar with Asm.js (other than browsing their homepage and slides and articles). But it seems like the people working in these communities have written off or not focused on JS ever being compiled to Asm.js JS and achieving near-native efficiency. And that instead, the focus is on more traditional languages with static typing compiling to Asm.js JS. And I suspect there's a reason for this, that it's hard or impossible to compile regular JS to use asm to achieve near-native efficiency. But I'd like to know specifically why, because in my naive view, it's possible (and even if really, really hard... totally worth it since you can then speed up all the JS that's ever been written to date and all future JS we write... and even if that's not possible that we can focus on avoiding certain features of JS to make compilation to Asm.js JS possible, i.e., a saner way to write Asm.js JS in JS).