Is Facebook working on a new compiler for PHP to speed up the language?
According to Alex Handy at SDTimes, Facebook is set to make some kind of major announcement regarding PHP on or around Tuesday, Feb. 2.
In a Jan. 30 blog post, Handy wrote:
““Well, I was able to put all the pieces together on this one, finally, and I now understand exactly what is up: Facebook has rewritten the PHP runtime from scratch. This coming Tuesday, they will make a big announcement around this project, and will make it available as open source software. I’m not really sure of any of the details of the project, but I do know that Facebook hired someone two years ago to do this, and I’m relatively sure this was a one-man project during that entire time.”“
Handy also said: “So, why has Facebook rewritten the PHP runtime? Because PHP is obviously too slow for their tastes.”
Jeff Cogswell, editor of Ziff Davis Enterprise’s DevSource, an eWEEK sister site, said:
“Very interesting. In the past I did a lot of work with PHP, and I was constantly fighting with the fact that PHP was SLOOOOOW. Which wasn’t a surprise when you look at the architecture of the engine.”
A commenter to Handy’s post, identified as “JohnP” cites another blog post by the “Rumpus” that describes what is said to be an actual conversation with a Facebook employee. Discussing a Facebook engineer and his current task, the blog said:
““Our site is coded, I’d say, 90% in PHP. All the front end – everything you see – is generated via a language called PHP. He is creating HPHP, Hyper-PHP, which means he’s literally rewriting the entire language. There’s this distinction in coding between a scripted language and a compiled language. PHP is an example of a scripted language. The computer or browser reads the program like a script, from top to bottom, and executes it in that order: anything you declare at the bottom cannot be referenced at the top. But with a compiled language, the program you write is compiled into an executable file. It doesn’t have to read the program from beginning to end in order to execute commands. It’s much faster that way. So this engineer is converting the site from one that runs on a scripted language to one that runs on a compiled language.”“
Meanwhile, regarding the notion that the company is working on an overhaul of its PHP systems, a Facebook spokesperson told eWEEK: “We have nothing to share at this time.”