Hacker News new | past | comments | ask | show | jobs | submit login

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.




LLJS targeting asm.js may help but it still looks like an early effort.

http://jlongster.com/Compiling-LLJS-to-asm.js,-Now-Available...

https://github.com/jlongster/LLJS


There 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.


I'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.


No, 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.


You 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).


Yeah, 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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: