The state of the art in JITs is LuaJIT2, despite almost no fanfare (and lots of fanfare by other JIT projects). I haven't had a look at hhvm yet, but if anyone wants a cool project, make hiphop emit Lua instead of C++, and run it under LuaJIT2.
LuaJIT2 really is magic, and Mike Pall is a humble but talented magician.
If they started with Python (or anything else) they would have ended up in the same place. They would end up writing their own compiler and VM because they want and they can. It's actually amazing that they didn't extend the language itself yet.
It's impossible to know what you'll need in the future. No one should be wasting too much time trying to figure it out.
How could Zuckerberg -- or anyone, for that matter -- have predicted the kind of rampant success Facebook has had? Who thought in 2005 that Facebook would become the largest photo sharing site on the web? Or that they would need to handle almost 140 million unique visitors per month?
If the largest problem of your business is your application stack, you are in a very good place. Most businesses have much larger problems like, say, cashflow.
LLVM isn't the worlds greatest target for a dynamic language, as Rubinius and Unladen Swallow found out. It does a lot of low level optimization, but a basic prerequisite to that is being able to do some sort of optimistic type-based optimizations, and LLVM has no infrastructure for that.
It looks like HipHopVM uses tracing which is probably a better way to go.
The hhvm is some nice piece of software, but it also takes many resources. This will always remind me to be very careful when making a design decision, like what language to use for project.
The justification for why it matters seems a bit "off" to me:
For perspective on why this matters, consider that many Facebook engineers
spend their days developing PHP code in an endless edit-reload-debug cycle.
The difference between 8-second and 5-second reloads due to switching from
hphpi to the hhvm interpreter makes a big difference to productivity,
and this improvement will be even more dramatic once we enable the translator.
Big leap of intuition follows, bear with me:
Clearly there are some very talented engineers working at Facebook, as evident by this project. On the other hand, apparently a large number of Facebook engineers are spending all their time in a run-debug cycle, trying to "make this darn thing work," and the engineers with talent are being used to incrementally improve the mediocre coders' lackluster productivity.
Guys, if three seconds in compile overhead makes such a difference in your productivity, maybe you should think for a few seconds about code correctness before you hit the compile button.
All engineers, those who work on HHVM like me included, spend their lives in a run-debug cycle trying to "make this darned thing work," whether "this darned thing" is a language runtime or the new photo uploader. The tighter you can make that loop, the more productive the engineer is, because she has less time to keep all the items she's mentally juggling pinned in volatile short-term memory.
Note that in many dynamic languages (and I think that includes PHP), syntax checking is done right before you try to run it, and type checking is performed at runtime. When you're programming in a Java IDE, these kinds of errors (and related ones, like typos in variable names, etc.) all get resolved while you're typing. In PHP or JavaScript you only find out once you run the program, so saving 3 seconds can be a huge win.
Of course, you can do static analysis to some degree which would cut down that time even further, but you may also get false alerts or miss some issues.
"The x64 machine code that the translator generates consumes approximately ten times as much memory as the corresponding HHBC. CPU instruction cache misses are a limiting factor for the large PHP applications that Facebook runs, so a hybrid between interpretation and translation may outperform pure translation."
This tells me that the engineers on the hhvm project are at least smarter than the engineers on the Java language.
[+] [-] mrich|14 years ago|reply
>The first 90% of the hhvm project is done; now we're on to the second 90% as we make it really shine.
[+] [-] k_bx|14 years ago|reply
[+] [-] josefresco|14 years ago|reply
[+] [-] keeran|14 years ago|reply
[+] [-] draegtun|14 years ago|reply
[+] [-] beagle3|14 years ago|reply
LuaJIT2 really is magic, and Mike Pall is a humble but talented magician.
[+] [-] enduser|14 years ago|reply
[+] [-] scotty79|14 years ago|reply
[+] [-] leftnode|14 years ago|reply
[+] [-] tyree732|14 years ago|reply
[+] [-] cbo|14 years ago|reply
How could Zuckerberg -- or anyone, for that matter -- have predicted the kind of rampant success Facebook has had? Who thought in 2005 that Facebook would become the largest photo sharing site on the web? Or that they would need to handle almost 140 million unique visitors per month?
If the largest problem of your business is your application stack, you are in a very good place. Most businesses have much larger problems like, say, cashflow.
[+] [-] ericmoritz|14 years ago|reply
I am sure I am trivializing the effort that it takes to make JIT for PHP.
[+] [-] rayiner|14 years ago|reply
It looks like HipHopVM uses tracing which is probably a better way to go.
[+] [-] aurelianito|14 years ago|reply
[+] [-] cpeterso|14 years ago|reply
[+] [-] js4all|14 years ago|reply
[+] [-] nodesocket|14 years ago|reply
[+] [-] lansing|14 years ago|reply
The justification for why it matters seems a bit "off" to me:
Big leap of intuition follows, bear with me:Clearly there are some very talented engineers working at Facebook, as evident by this project. On the other hand, apparently a large number of Facebook engineers are spending all their time in a run-debug cycle, trying to "make this darn thing work," and the engineers with talent are being used to incrementally improve the mediocre coders' lackluster productivity.
Guys, if three seconds in compile overhead makes such a difference in your productivity, maybe you should think for a few seconds about code correctness before you hit the compile button.
[+] [-] kmavm|14 years ago|reply
[+] [-] monopede|14 years ago|reply
Of course, you can do static analysis to some degree which would cut down that time even further, but you may also get false alerts or miss some issues.
[+] [-] donspaulding|14 years ago|reply
[deleted]
[+] [-] spitfire|14 years ago|reply
This tells me that the engineers on the hhvm project are at least smarter than the engineers on the Java language.
[+] [-] rat87|14 years ago|reply