Videos
Online Javascript compiler
[AskJS] I wonder why there is no javascript compiler?
compilation - Is there a native machine code compiler for JavaScript? - Stack Overflow
Boa: a JavaScript interpreter and JIT compiler written in Rust
I don't actually see a JIT in the repo. Looks like a conventional interpreter.
More on reddit.comHow can I create an online Javascript compiler to compile and execute Javascript real-time online? I'm building an interactive Javascript editor using Monaco editor but need ideas for compiler and real time output. Some ideas I have is an express app with babel compiler and use vm2 to run the code? Any more sophisticated ideas?
since javascript is such a popular language,why there has no js compiler that can beat node.I realy like
js syntax,but node is really slow
As far as I know, there are no static compilers for JavaScript. It is certainly theoretically possible; however, a static compilation of JavaScript would need a very heavyweight runtime to support all of its features (such as dynamic typing and eval). As a small aside, when presented with the need to statically compile Python (another dynamic language), the PyPy developers ended up creating a language which was a very restricted subset of Python (called RPython), void of some of Python's more dynamic features, that was capable of being statically compiled.
If you're asking this for the purpose of creating a standalone executable from JavaScript code, I'm sure there must be wrappers which essentially would create an executable containing your script and an embedded JavaScript VM (sadly, I don't know any offhand).
It's definitely doable, although the only way I know how to do it at the moment is a two step process...
- Compile the javascript to Java using Mozilla Rhino JSC.
- Compile the resulting java class file to executable using something like GNU's GCJ.
Why would you want to, though? What advantage do you expect to find?