6 ms·
By the way, there is an alternative to HipHop that is actually easier to implement because it makes php extensions. It's called PHC http://phpcompiler.org http
by ck2 14y ago
By the way, there is an alternative to HipHop that is actually easier to implement because it makes php extensions.
It's called PHC http://phpcompiler.org http://phpcompiler.org and it's open source.
It was Paul Biggar's PhD thesis http://blog.paulbiggar.com/archive/a-rant-about-php-compilers-in-general-and-hiphop-in-particular/ http://blog.paulbiggar.com/archive/a-rant-about-php-compiler...
It just needs some community contributions to catch up.
- pbiggar 14y agoWhile you are very kind to say so, even the original Hiphop blew past what phc could do. Importantly, phc did not support the full PHP language (we had basic object support, and no support for magic methods). There were two cool things about phc: that it had a really advanced static analyzer, and that it compiled to modules compatible with zend. However, these are somewhat mutually exclusive, and making them work well together is an open problem (though I had some ideas). I moved on from phc, and there's no-one left in the community really. I now run https://circleci.com https://circleci.com (applying my compiler knowledge in a different way). I tried to pass the reigns on, but nobody stepped up. Hard to find people who love PHP but are also able to hack on compilers.
- ck2 14y agoMaybe you were just half a decade before your time and the rest of us had to catch up. I worry the php community is losing or has lost some of the really smart folks. Suhosin (Stefan Esser) is also fading away without any updates to work with php 5.4 and that's really sad, especially considering the radical performance improvements and memory-use reductions found in 5.4 and 5.5 vs 5.2 - 5.3
- pbiggar 14y agoThe PHP internals community is quite a poisonous place, IMO. Its a community that destroyed itself by being hostile to everyone who wasn't one of them.
- dkhenry 14y agoI think that's a function of their inability to let go of their own work. The internals of PHP need a _complete_ overhaul to make PHP competitive on a speed/memory basis with the python and rubys of the world, but that would mean throwing away a lot of work by the current contributors and probably re-architecting things like zvals and internal opcode representation. That's something I don't think they are willing to do, and I don't know if there is enough community around the zend core to really get it done even if they wanted to.
- pbiggar 14y agoI wouldn't know if that's the reason, but totally agree that the internals need a total overhaul. The entire codebase was a complete mess - hacks built on hacks built on hacks. Each variable takes what - 96 bytes I think on 64bit machines? The opcodes are terrible. The interpreter dispatch is switch based, and funnily enough it doesn't matter because the rest of the engine is so slow (function dispatch in particular) that interpreter dispatch doesn't even matter. Disclaimer: I dont think I've looked at PHP source in 3 years, it might have changed significantly but I suspect it has not. I'd love to be corrected with some detail!
- haberman 14y agoWhat's wrong with switch based dispatch? Lua's dispatch is switch based, and it is the fastest mainstream bytecode-based VM out there last I checked.
- pbiggar 14y agoLua's dispatch wasn't chosen because it was the fastest. If you read their Lua5 paper, they discuss how they prioritized being portable ANSI C over speed. Indirect threading is the fastest simple technique, but you can do even better. See section 3.3 of http://www.cs.tcd.ie/publications/tech-reports/reports.07/TCD-CS-2007-49.pdf http://www.cs.tcd.ie/publications/tech-reports/reports.07/TC... for a discussion.
- runekaagaard 14y agoSlightly OT, sorry. phc was such a nice project, and vastly unappreciated. Your cleanup of PHP's grammar was a piece of art which I spend a long time perusing through and trying to understand! phc could have largely benefited the PHP community as a whole and it's such a shame it couldn't gain (enough) traction! Never got a chance to say thx, so THX!