Facebook Friends PHP: Introducing HipHop
Are you a fan of PHP? Facebook is. The company has been working behind the scenes to create HipHop, a runtime compiler for PHP to improve the language's performance on Facebook's servers. The company is also friending the rest of the PHP community with its work by releasing its project as open source.
Rumors have been flying for a while, and the news was confirmed on Monday by ReadWriteWeb. Facebook gave a talk on Tuesday night about HipHop to introduce the technology at the company's headquarters in Palo Alto, CA.
HipHop is a just-in-time (JIT) compiler for PHP that converts PHP into C++, which is then compiled. HipHop provides a Web server and doesn't require a separate server, though it can work in conjunction with another. There is some functionality missing from HipHop compared to PHP 5.2, so existing code may need to be rewritten. Though Facebook says that it's "beta-quality" Facebook already appears to be using HipHop on production servers to handle much of their traffic.
Marco Tabini, co-founder of php|architect says he was invited to Facebook early to get a look at HipHop, and gave him a copy to play with before the announcement. Tabini says that HipHop has "the potential to be an incredibly disruptive product in the PHP landscape." Tabini also notes that it might make Facebook a major player in the development of PHP itself. "You have every incentive to make sure that your application runs with HipHop—which could give Facebook a unique opportunity to exert significant control over the way PHP evolves."
If you're running a standard PHP-based site, don't get too excited just yet. According to PHP developer Brandon Savage it's good for large-scale Web applications written in PHP, but not so much for single-server Web sites using PHP. "Since HipHop runs one web application at a time (with a built-in webserver), it’s impossible at the moment to run more than one website on a box. This is obviously less than optimal for most folks, and will limit adoption." He also notes that it doesn't support PHP 5.3 as of yet.
Facebook has been participating in several open source projects as it grows. The company sponsors or participates in a number of projects including snapshots of its own platform (Facebook Open Platform), and Thrift, a software framework for cross-language service development.
HipHop is being released under the PHP license and will be hosted on GitHub when code is available.