What about using a virtual machine for running PHP, like Parrot? Do you think it would be faster than a current implementation?
pbiggar
Well, PHP already runs in a virtual machine. If you mean a JITted virtual machine, then sure, that would be faster. But JITs are hard to write. If you mean a bytecode-interpreter, which is how most virtual machines including Parrot are written, then it wouldn't necessarily be any faster. In practice it might be, since the Zend engine is quite poor. but I don't know how good Parrot is.
There have been a few projects to run PHP on Parrot, I think Pipp used to use phc, but maybe doesn't anymore.
work on Pipp has pretty much stalled in the last year. This is mostly due to me being busy in $DAYJOB.
Pipp used to transform the XML-Dump of phc-AST into an AST that is usable by Parrot. The stylesheets are still in the Github repo, but
I haven't kept it synchronised with changes in phc and Parrot.
The neat idea with Parrot is that languages running on top of Parrot can share their modules.
The concept of a PHP compiler is hugely novel. I want to make my PHP go faster. I know that compiled languages are generally faster than interpreted langauges and VMs and such, but its such a big leap to make that converting the PHP constructs into C-Style data structures will result in a performance increase.
I read your thesis and looked at your code after the first time I saw you on Reddit. There are such grand claims to be made about the analyser's coverage and code generation ability, that I'm impressed at what a competent developer you must be.
So yes, HPHP is great, because it's a PHP compiler and you're one of the first guys to do it. i'm so sad that you aren't getting more recognition for your research. I lament that you "stopped liking PHP" and that you didn't continue with the project.
[Editor's note: Actually, this guy said the opposite, but in such a dickish way that I decided to childishly write over it. If "a fellow student" wants to make his point without acting like a prick, I'm happy to listen to criticism.]
Arya Reais-Parsi
This blog post of yours, good sir, is just brilliant.
Re #10, it's because they wanted any solution that might give them a serious speed boost to be done in-house so they could maintain a technological competitive advantage. However, it would have been a bad decision both in terms of karma, public perception, and most importantly financially, to patent this unless they were really sure they could see that through to the end. And the USPTO would probably look for 'prior art', find yours, and start asking them all kinds of questions about why they should grant Facebook a patent when it was clear this was something people did anyway. I don't think they could take that risk.
Just a hunch.
-Chilton
pbiggar
I think its unlikely that the patent office would look too hard... I hope they decided there was no value to a patent instead.
well as to the "need" to have a "faster php"...tools like yslow are informative
for my relatively high traffic site (in top 500 of all sites), the time to generate pages on the server is never more than 5% of the user's total latency to see a rendered page. of that 5% slice, i know on the server that about half of that is spent in the database.
so yes, i *can* move that needle, but doing so is not going to substantially improve performance for my users. if i were to spend time improving my js, i'd probably get a much better result for my time spent
87c51 FTW
Ah, my friend... that's the funny thing about being ahead of the pack.
"Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats." ~Howard Aiken
If it helps, you're not the only guy that thought about this.
You're just the only one who succeeded in public, but no one threw any ticker-tape over it.
And that sucks. Here's a more complete explanation:
I have no end of admiration for you and your work, but in the end being a pioneer tends to be a bit of a crapshoot. Pioneers almost NEVER get any recognition.
I tried to write a cross-compiler for PHP that converted the code into a windows executable using compiled basic - and ended up writing a different language altogether. And now I use it just for me - think of it being like a cross between lisp and visual basic. It's amazingly productive, but no one else knows about it. I can't share it, and that makes me wistful. On the other hand, I basically bill out my time at 1 day per hour of actual work. It helps make the shame more palatable.
About "doing it right".
I constantly tell my programmers that in general, bug-free hacked up crap that can be done in a week and sold tomorrow is infinitely better than months of careful optimization and analysis with a mind towards "doing it right" and attempting to solve all the implied constraints.
They openly mock me and my "hackety-hacked" up software approach, all created with nary a whiff of object orientation or trendy functional programming - and yet, I consistently knock out flea-bitten commercial software and make money from it. I don't care about the money, but it comes to me anyway.
For: Nothing stops you from forking your own project, strip out the eval and the libraries you don't need, and cobble up some documentation and sell it for 199 pounds, or better yet 999 pounds, or euros, and soon enough you'll have sold a few copies. Find an honest bloke with some business sense and offer him 25% and you'll probably sell 100x as many copies as you would by yourself. You'll be able to spend your recognition, since it will be in coin of the realm.
Against: Making 240K euro in a year probably isn't worth the hassle. The world changes once you start making money directly from your craft. The change isn't always a nice one. I make enough to drive sports cars and fly helicopters and go traipsing around the world, but I've lost my freedom to be ignorant of the real world, and that has a price. Once you've looked behind the curtain, it's easy for the mystery to go out of it. Also, I'm married, and that changes things quite a bit.
In any case, I just want to say: Thank you for working on this project.
And they have little hissy fits about it,
Yaa101
I have a feeling that they translate the literal source code instead of the functional code that works inside the PHP interpreter, however this means you cannot make syntactical errors. When doing it this way you can keep out a lot of these interacting side effects under the hood (like references), it does means you really need to know what coders are meaning.
I am not saying that the above sentence is true, but it's a hunch I have as an PHP programer for the larger part of the last decade.
I also think many roads lead to Rome, some are bumpy, some are scenic and some are fast and it depends really on what the traveler really wants, choice is almost never a bad thing.
Oh yes, XUL and Javascript are merely another way of doing the same things and as maintainer of a Firefox Add-on I can say that I find that platform much more immature and shaky than the PHP one.
In the end I think much of choosing a programming platform has to do with how we the programmers are wired in their heads.