Is Emscripten (or llvm compilers or transpilers) single purpose specifically used to convert c/c++ programs to JavaScript(ASMjs). Im reading places how ASMjs is going to be faster than direct JavaScript. And in my eyes therefore better than coding in straight javascript. But how will the program be faster than writing directly in JavaScript. How is this possible. Aren't programs fastest when it can get straight to the main programs execution rather than having to be compiled first
Asked
Active
Viewed 129 times
1
-
Try to give definitions for an "ASMjs program" and "direct javascript" and you'll see. – Bergi Jun 18 '15 at 00:21
-
Maybe have a look at [Can regular JavaScript be converted to asm.js, or is it only to speed up statically-typed low-level languages?](http://stackoverflow.com/q/15626611/1048572) – Bergi Jun 18 '15 at 00:23
1 Answers
-2
ASM.js is optimized JavaScript, which is what makes it faster than writing directly in Javascript. That's really all there is to it.
The compilation step is something that would happen to convert C/C++ and produce the ASM.js source, which would then be given to browsers, etc. It wouldn't need to be recompiled unless the source changed, so therefore there is no compilation step when the ASM.js is part of a web application.

Sanch
- 1