Facebook Formally Announces HipHop For PHP

HipHop for PHPAfter ongoing rumors of a new version of PHP being released by Facebook today, the company has officially announced HipHop for PHP: a source code transformer. For those who suggested that it was a new compiler, it isn’t exactly that. And no, Facebook has not rewritten PHP all together. While I don’t understand much about the technicalities behind compilers, Haiping Zhao has posted complete details about the project.

ipHop for PHP isn’t technically a compiler itself. Rather it is a source code transformer. HipHop programmatically transforms your PHP source code into highly optimized C++ and then uses g++ to compile it. HipHop executes the source code in a semantically equivalent manner and sacrifices some rarely used features — such as eval() — in exchange for improved performance. HipHop includes a code transformer, a reimplementation of PHP’s runtime system, and a rewrite of many common PHP Extensions to take advantage of these performance optimizations.

Get it? Aside from understanding that the eval function will no longer be available, I don’t quite understand the new system. From an engineering perspective, HipHop for PHP is nothing short of phenomenal. Haiping Zhao started off developing the product as a service which could transform PHP code into C++. As he writes, “We knew that it was impossible to successfully rewrite an entire codebase of this size by hand, but wondered what would happen if we built a system to do it programatically.”

The project has taken two years: eight months to have a version that could be demonstrated, ten months finishing up all the coding, and six months testing the service on production servers. This evening the company will be hosting live streamed tech talk to discuss HipHop for PHP and what the project means for developers. If you have a service which handles hundreds of millions of monthly users (not likely) or just have an interest in impressive software engineering feats (more likely), you can tune in via the Facebook blog post.

HipHop for PHP transformation process diagram

  Tags:, , ,



Recommended Articles


Inside Social Apps 2012 is Less Than Two Weeks Away

Inside Social Apps, held on February 8-9 in San Francisco, is less than two weeks away. This is the third conference on the future of monetization on social and mobile platforms. Leaders from the industry will share their views on today's most formidable challenges affecting social and mobile apps and games in 2012. Inside Social Apps conferences sell out in advance, so take advantage of early registration pricing. Early bird rates end on February 1, so register today.

7 Comments »

  1. did you mean "formally?"

    Comment by Jen — February 2, 2010 @ 9:19 am

  2. wow… what

    Comment by Neil Vidyarthi — February 2, 2010 @ 9:29 am

  3. What an intensely stupid name, really trendy but it appeals to sub literates at best.

    Comment by Tupper Lake — February 2, 2010 @ 11:34 pm

  4. Well, this will pretty much be used by … facebook only.

    Comment by Derrick — February 3, 2010 @ 5:19 am

  5. "Tupper Lake – February 3rd, 2010 at 3:34 am

    What an intensely stupid name, really trendy but it appeals to sub literates at best."

    Wow. Can't believe this notion that black music = sub literate genre still exists. I guess it should have been called "Folk Music for PHP"?

    Comment by crazzer — February 3, 2010 @ 9:51 am

  6. If eval doesn't work, I wonder if some other features such as calling function names by strings will work.

    Comment by Dan Moore — February 7, 2010 @ 8:02 am

  7. What's the benefit?

    Comment by Roy — February 7, 2010 @ 8:18 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Send us a Tip

tips@allfacebook.com
[Inside Social Apps 2012]
[AllFacebook Stats: Facebook Analytics for Your Business]
[How can Facebook change your business?]

Upcoming Events

Inside Social Apps

February 8-9, 2012 | San Francisco

Inside Social Apps

Developing & monetizing on social & mobile platforms

Social Gaming Summit

23-24 May, 2012 | Berlin

Social Gaming Summit

Where Gaming Meets the Social Web

AllFacebook Marketing Conference

June 28-29, 2012 | San Francisco

AllFacebook Marketing Conference

Your how-to guide for Facebook marketing.