Facebook unveils HipHop for PHP 'source code transformer'

It's pretty much common knowledge that speed is the key aspect to the Internet. If a website isn't fast, chances are, people won't use it. Slow Internet connections will do nothing but frustrate users, as well as damaging companies. Google is a company that is intent on increasing speed, even by tiny amounts, in order to provide the best possible user experience. Earlier, Facebook announced its own developments that will help improve the speed, in the form of a 'source code transformer.'

Developers at Facebook have been working on a rather important project for the last two years, dubbed HipHop for PHP. The announcement, made on Facebook's developer blog, lists the improvements of this project, as well as what it actually aims to do. According to Facebook, HipHop for PHP isn't a compiler, but rather is a tool designed to convert PHP into highly optimized C++, and then compile it with g++. HipHop currently includes the code transformer, Facebook's own implementation of PHP's runtime system, as well as a complete rewrite of many PHP Extensions, in order to gain speed. 

What does all this mean? Essentially, a better Facebook. The company claims that it has been able to reduce CPU usage on web servers by up to 50%, depending on the web page, which is a massive reduction for a site as large as it is. We're not going to go into fine detail on how it works – you can check out the previously linked Facebook blog post for that – but you should know that you've been testing this out yourselves for the past six months. 90% of Facebook's traffic uses HipHop now, only after half a year of it being suitable for widespread usage. As per tradition, Facebook will releasing their code on github soon, meaning that other developers will be able to view the source code themselves.

Report a problem with article
Previous Story

Twitter resets passwords due to phishing attack

Next Story

In-depth overview of Windows Home Server "Vail" Build 7360

18 Comments

Commenting is disabled on this article.

Cool idea, I'd like to see this software firsthand.

Am I the only one that thought of these lyrics, after reading the title : "They call me the hiphop-potamus, My lyrics are bottomless" by flight of the conchords?

http://www.neowin.net/news/facebook-employee-interview-reveals-security-issues
Am I the only one who became sure now that this interview was real ?

kInG aLeXo said,
http://www.neowin.net/news/facebook-employee-interview-reveals-security-issues
Am I the only one who became sure now that this interview was real ?

other than being about facebook, what does this have to do with anything??

carmatic said,

other than being about facebook, what does this have to do with anything??

The last paragraph in the interview, which is mentioning a thing very near from what is written here.

"HipHop for PHP isn't a compiler, but rather is a tool designed to convert PHP into highly optimized C++"

Sounds like a compiler to me.

boogerjones said,
"HipHop for PHP isn't a compiler, but rather is a tool designed to convert PHP into highly optimized C++"

Sounds like a compiler to me.

its not ... its more of a framework/translator than a compiler - it is converting one high level language to another high level language. The actual compilation from Source to Binary is done by g++.

georgevella said,

its not ... its more of a framework/translator than a compiler - it is converting one high level language to another high level language. The actual compilation from Source to Binary is done by g++.

The term compiler as I understand is converting one source language to another target language. As long as the two languages are different, one has to do all the compilation processes such as scanning, parsing, semantic checking and code generation. So, whether the target language is binary or another high level language, I think it is still a compiler. :)

morrizz said,
The term compiler as I understand is converting one source language to another target language. As long as the two languages are different, one has to do all the compilation processes such as scanning, parsing, semantic checking and code generation. So, whether the target language is binary or another high level language, I think it is still a compiler. :)

No, for it to be a compiler it MUST produce machine executable code - that is, by definition, the function of a compiler.

What they have produced (from high level to high level) has lots of names (e.g. language translator, source to source translator or language converter) and is more like going from French to German than English to mathematics.

It kind of depends on how strict your definition of compiler is, and I've seen some dictionaries that are, in my opinion, not strict enough. These say a compiler is going from a source language to a target language. I'd agree, this program is doing this. I'd just disagree with this definition as a compiler.

If you're going by Merriam-Webster, a compiler is a computer program that translates an entire set of instructions written in a higher-level symbolic language (as C) into machine language before the instructions can be executed. This program is not doing this, as no machine code is generated. That's what g++ is doing.

Pong said,
No, for it to be a compiler it MUST produce machine executable code - that is, by definition, the function of a compiler.

What they have produced (from high level to high level) has lots of names (e.g. language translator, source to source translator or language converter) and is more like going from French to German than English to mathematics.

What do they call the program that turns Java source code in the JDK or C# code .NET Framework into bytecode, that then becomes Just In Time Compiled at runtime?

boogerjones said,
"HipHop for PHP isn't a compiler, but rather is a tool designed to convert PHP into highly optimized C++"

Sounds like a compiler to me.

It's about the suitability of terms, and what you have described is language translation plain and simple. Given that it subsequently compiles the C++ using g++, to call the whole operation "compiling" is unnecessarily confusing.

dotf said,

What do they call the program that turns Java source code in the JDK or C# code .NET Framework into bytecode, that then becomes Just In Time Compiled at runtime?

Because the JVM is a Virtual Machine. As such, bytecode is machine code.