Facebook is into Hiphop, PHP just got pimped!

by Lance on February 2, 2010

Now calling all PHP fanboys to rejoice finally.

Facebook’s new toy is not a new compiler nor an engine, according to its creator it is a “source code transformer“, really funky right? After all its a crank from their previous hackaton around 2 years ago.

So how does it work?

The main challenge of the project was bridging the gap between PHP and C++. PHP is a scripting language with dynamic, weak typing. C++ is a compiled language with static typing. While PHP allows you to write magical dynamic features, most PHP is relatively straightforward. It’s more likely that you see if (...) {...} else {..} than it is to see function foo($x) { include $x; }. This is where we gain in performance. Whenever possible our generated code uses static binding for functions and variables. We also use type inference to pick the most specific type possible for our variables and thus save memory…

And what does it mean to web developers?

I think it’s pretty exciting! 50% performance increase is too good to be true! (90% of Facebook is running on Hiphop now) and for such a large scale deployment in just 6 months its really amazing.  Now you can forget purchasing that Zend Server and instead create a github account and consider following Facebook’s Official GitHub Account where they commit their open source projects.

You can read more about the Official Announcement from the geek who made it.

Update: While it is indeed exciting, there are a few caveats that every web developer should know before diving into HipHop. Here’s an in depth explanation by Terry Chay, He was invited by Facebook along with the biggest names on the PHP world to attend a super-secret conference a week before HPHP was announced.

If you’re interested, you might want to check the official developer mailing list of the project on Google Groups.

Leave your comment


Required. Not published.

If you have one.