Somebody is writing a compiler for PHP, compiles down to machine code, outperforms HHVM
Yes, that’s right. Recki-CT compiles PHP down to machine code.
It’s unbelievable what’s going on in the PHP world in the last few years! What an extremely fast and professional movement! The latest maybe-sensation comes from the guy who has – beside other things – written the popular password hashing functions in PHP 5.5+ (and the password hashing functions compatibility library for PHP 5.3+) that has probably saved masses of thousands of developers from getting fired by providing a highly professional password hashing/salting API. At a time when LinkedIn, Sony and Deutsche Bank were “still” using md5 hashing.
Anthony Ferrara is currently writing a real compiler for PHP. In PHP. An according to some tests it’s extremely fast, even outperforms HipHop / HHVM.
Blog post: http://blog.ircmaxell.com/2014/08/introducing-recki-ct.html
Note: There are already some real pre-compilers for PHP, but they are quite unpopular, outdated, not maintained, can only compile PHP extensions etc. and I also don’t have the skill and the knowledge to judge this in any way. It would be interesting to ask Facebook’s HHVM team why they created HHVM (with a lot of effort!) instead of using and improving already existing compilers (that would be even faster by the way) or writing a full compiler. Interesting topic.
The problem with most PHP compilers is that PHP language supports a lot of features which are very hard (or nearly impossible) to compile directly to machine code.
Most of these compilers only support a subset of PHP language (the one from this article is not an exception). That makes them less useful, because most existing PHP applications weren’t written with these compilers in mind.
Also, some current PHP VMs (eg. HHVM, PHP-NG) can already achieve performance close to that of PHP compilers, while supporting most (if not all) PHP language features.