Arguably there are already couple of popular compilers [0] for JavaScript (Babel, Closure Compiler, minifiers etc.). They just don't target native CPU assembly.
[0] Compiler is just a program that transforms code from one representation to another.
But a compiler for what? Plain JS without any APIs? JS that uses the Node.js API? JS that uses the Web APIs? The problem with base JS is that it's a general purpose scripting language that lacks some of the basics that you need before you can compile the code as something that can "do a thing" on its own, without still needing an interpreter for the third party APIs the code tries to make use of that rely on out-of-language hooks (like Node.js)
If you look at Hiphop vs. HHVM there is certainly a significant performance upside in taking advantage of clangs or gccs ability to produce efficient code.
I'm not sure why Facebook decided to stop maintaining hiphop. Perhaps manageability wasn't great.
Perhaps. JIT compiler has to care deeply for compilation time. For AOT compiler compilation time is a little bit less pressing problem which leaves some space for optimization passes that take too long for JIT.
This would be pretty useful. Something like hiphop which could transpile into C or C++ would mean we (IncludeOS) could build tooling to run a node application on directly in a vm without a underlying OS.
[0] Compiler is just a program that transforms code from one representation to another.