日度归档:2010年4月15日

关注一下 Facebook 的 HipHop (能把php转成c++,太酷了)

目前HipHop还是试验性质的,据说FaceBook用它用了一年多了,很稳定,但是毕竟它本身就是做出来给facebook用的。还是非常的希望它能继续发展,能解决php作为脚本语言上的众多劣势!

HipHop的介绍

HipHop for PHP transforms PHP source code into highly optimized C++. It was developed by Facebook and was released as open source in early 2010.
HipHop transforms your PHP source code into highly optimized C++ and then compiles it with g++ to build binary files. You keep coding in simpler PHP, then HipHop executes your source code in a semantically equivalent manner and sacrifices some rarely used features – such as eval() – in exchange for improved performance.
Facebook sees about a 50% reduction in CPU usage when serving equal amounts of Web traffic when compared to Apache and PHP. Facebook’s API tier can serve twice the traffic using 30% less CPU.
Why HipHop
One of the explicit design goals leading into HipHop was the ability to continue writing complex logic directly within PHP. Companies with large PHP codebases will generally rewrite their complex functionality directly as PHP extensions in either C or C++. Doing so ends up reducing the number of people who are able to work on the company’s entire codebase. By keeping this logic in PHP, Facebook is able to move fast and maintain a high number of engineers who are able to work across the entire codebase.
HipHop is not the right solution for everyone deploying PHP. We think it will be useful to companies running very large PHP infrastructures who do not wish to rewrite complex logic within C or C++.

Using HipHopcheckout and build instructionsgit clone git://github.com/facebook/hiphop-php.gitHipHop currently supports PHP version 5.2 and will be updated to support 5.3. The software is open source and we hope that it’s useful to many companies around the World.You can learn more on Building and installing or Building and installing on Ubuntu 9.10. See Running HipHop to learn more about compiling your source code.
Discussion and supportYou can discuss HipHop for PHP and report bugs on the HipHop developer mailing list (or feel free to submit a Pull Request).The wiki content is licensed under Creative Commons Attribution-ShareAlike License
上面是Facebook上的资料,可能国内上不了 facebook,想要资料先翻墙吧~~

http://wiki.github.com/facebook/hiphop-php/