5 ms·
Eh, it's possible to write asm.js just much harder than regular JavaScript. Keep in mind Operating systems were written in assembly, asm.js is not as bad as as
by Ygg2 13y ago
Eh, it's possible to write asm.js just much harder than regular JavaScript.
Keep in mind Operating systems were written in assembly, asm.js is not as bad as assembly in some regards.
- TheZenPsycho 13y agoThere are constraints to asm.js that are restrictively difficult for a human to maintain. If your code doesn't pass the validator it runs as normal JS.
- jevinskie 13y agoLLJS targeting asm.js may help but it still looks like an early effort. http://jlongster.com/Compiling-LLJS-to-asm.js,-Now-Available- http://jlongster.com/Compiling-LLJS-to-asm.js,-Now-Available... https://github.com/jlongster/LLJS https://github.com/jlongster/LLJS
- camus2 13y agoI'm not writing an operating system.The point is you cant get these perfs with using regular javascript.ASM.js is not regular javascript,since it's a subset.
- Ygg2 13y agoNo, but this operating system is the example of most performant, least resource hungry application I can think off. If you need performance you don't write C, you write assembly. Same with asm.js.
- pjc50 13y agoYou try to avoid writing in assembly unless you absolutely have to, because it's a big maintenance pain and unless all your assumptions are correct it may not be as fast as the compiler. It's not worth bothering with unless you're vectorising or want to use some other instructions that are not normally emitted (e.g. ARM add-with-saturation).
- Ygg2 13y agoYeah, but assembly generally isn't portable (x86 assembly is different than ARM assembly, etc.), that's what makes it biggest pain IIRC. Asm.js on the other hand, is portable and just that makes it way better than any regular assembly. Also it seems better looking than regular assembly (no registers as such, no jumps, etc.). It's a huge step back compared to plain JS, but it's not that impossible to write in.