3 ms·
The reason people call C portable assembly is because it's about as low as you can go without coding in assembly, and still have it compile to various platforms
by eliasmacpherson 13y ago
The reason people call C portable assembly is because it's about as low as you can go without coding in assembly, and still have it compile to various platforms.
You are really comparing asm.js and C as portable assembly emitters rather than targets. That said, people very occasionally use C as a target like they use asm.js, e.g. the original C++ compilers, the mars rover.
asm.js is as low as you can seemingly go and have it run in a modern version of Chrome and Firefox, but those requirements prevent it from being a portable assembler in the sense that C is. In addition, it's sensible to write your program in another language first before asm.js, as I understand it.
There's a whole swathe of machines (rather than users) out there that cannot run a modern version of those browsers, i.e. asm.js is not portable to them.
When the code being written in and transposed from is asm.js and the destination is some other language - then asm.js will be portable assembler in the sense that C is.