11 ms·
Facebook rewrites PHP runtime, will open source on Tuesday
Facebook has been rewriting the PHP virtual machine for the past 2 years in an effort to make it faster. On Tuesday, they will announce the release of this software as a new open source project.
- senko 17y ago> That team were forced to sign NDA's, and taken to a very quiet, secluded meeting room where some cool new Facebook-backed open source project was described. This caught my eye - an interesting use of the term "open source" that I haven't previously been aware of. This is only a single datapoint (and the article states the project is going to be opened up anyways), but I do have a feeling the term has been diluted and joined the buzzword ranks.
- jrockway 17y agoIt's "open source" as in, "we'll release it as open source when we are good and ready". So far, that's been never.
- VonGuard 17y agoYeah, open source is kinda a verb now. Anyway, Facebook has other open source projects: see Hive http://www.facebook.com/pages/Hive/43928506208 http://www.facebook.com/pages/Hive/43928506208 Kinda silly to have a facebook page for an open source project, though.
- jmatt 17y agoHere's the main page for open source facebook projects: http://developers.facebook.com/opensource.php http://developers.facebook.com/opensource.php I agree it's a bit silly. I think they hope that it'll catch on sometime in the future and they'll have yet another type of group socializing on facebook.
- jackowayed 17y agoYou mean people actually socialize on Facebook pages? It seems that the only effective purpose for pages is for celebrities/companies to push updates to their fans (and almost always ignore the reverse direction), and groups are even worse. Most pages and groups I see are things that you join because you agree with/identify with the name and then totally ignore. I wonder if facebook a) cares, and b) could do something to fix it.
- jmatt 17y agoYa I used to agree with you completely. I still do for the majority of pages out there. I recently learned of a counter example. There is a locally owned sports bar and restaurant that has a very active group. Most of the members are fans of sports teams that are across country and the games play regularly at this bar. The owner is active in the group too and definitely encourages and responds to conversation. The other group I know that is relatively active has more or less the same characteristics. It's people who identify with the group but are otherwise disjoint - and this is the best way for them to casually communicate. I think it's safe to say this was the original intent of groups and pages. Celebrities and companies are just taking advantage it. Of course, I have a handful of pages on my facebook profile, so I guess I'm as guilty as anyone else. (I'm With COCO!) EDIT: abusing -> taking advantage
- matthew-wegner 17y agoThis was mentioned in that anonymous Facebook employee interview: http://news.ycombinator.com/item?id=1089800 http://news.ycombinator.com/item?id=1089800 Specifically: Rumpus: So tell me about the engineers. Employee: They’re weird, and smart as balls. For example, this guy right now is single-handedly rewriting, essentially, the entire site. Our site is coded, I’d say, 90% in PHP. All the front end — everything you see — is generated via a language called PHP. He is creating HPHP, Hyper-PHP, which means he’s literally rewriting the entire language. There’s this distinction in coding between a scripted language and a compiled language. PHP is an example of a scripted language. The computer or browser reads the program like a script, from top to bottom, and executes it in that order: anything you declare at the bottom cannot be referenced at the top. But with a compiled language, the program you write is compiled into an executable file. It doesn’t have to read the program from beginning to end in order to execute commands. It’s much faster that way. So this engineer is converting the site from one that runs on a scripted language to one that runs on a compiled language. However, if you went to go talk to him about basketball, you would probably have the most awkward conversation you’d have with a human being in your entire life. You just can’t talk to these people on a normal level. If you wanted to talk about basketball, talk about graph theory. Then he’d get it. And there’s a lot of people like that. But by golly, they can do their jobs.
- jrockway 17y agoThe computer or browser reads the program like a script, from top to bottom, and executes it in that order: anything you declare at the bottom cannot be referenced at the top. But with a compiled language, the program you write is compiled into an executable file. It doesn’t have to read the program from beginning to end in order to execute commands. It’s much faster that way. I lost count of the number of untrue statements there after about ten.
- scorxn 17y agoIs there an implication that all this optimization could be merged into PHP core? PHP's appeal is ubiquitous support. Even if it is open-sourced, I can't imagine a bunch of hosting companies suddenly serving Facebook-flavored PHP.
- pbiggar 17y agoThe PHP internals developers heaped scorn on compilation when I talked to them about phc (http://phpcompiler.org http://phpcompiler.org). I think it might be different with a Facebook seal of approval though.
- jerf 17y agoShould the current internal developers object to the idea even when implemented, well, "a new set of PHP internals developers" would not be the worst thing that ever happened to PHP....
- knieveltech 17y agoI, for one, welcome our new Facebook overlords.
- jganetsk 17y agoWouldn't it have been easier to have moved away from PHP? From what I understand, Facebook only uses PHP for the most front of ends. Business logic is all in other languages. Isn't it easy to port the front-end into something else?
- olalonde 17y agoWhat other languages? (genuine question)
- Zev 17y agoErlang, C++, Java, Python and possibly others that I can't quite remember. See http://www.infoq.com/presentations/Facebook-Software-Stack http://www.infoq.com/presentations/Facebook-Software-Stack for actual details.
- deleted 17y ago[deleted]
- adrianwaj 17y agoReddit was rewritten from Lisp to Python: http://www.aaronsw.com/weblog/rewritingreddit http://www.aaronsw.com/weblog/rewritingreddit Twitter from Ruby into Scala and JVM: http://www.artima.com/scalazine/articles/twitter_on_scala.html http://www.artima.com/scalazine/articles/twitter_on_scala.ht... I think there are two aspects of a language (correct me if I am wrong) -- it's elegance/simplicity/breadth of code produced by programmers that write with it --- and then the efficiency/effectiveness/HW-optimized executable code produced by its compiler once it's run: so how does PHP and Facebook fit in with all this?
- munctional 17y agoTwitter's frontend is still definitely Ruby (on Rails). Based on what I've heard from people who have consulted there, it's a gigantic ball of crap. They've so heavily patched Rails 2.0 that they can't realistically migrate to a more modern version of Rails.
- n8agrin 17y agoThe article is completely unsubstantiated. Well, I was able to put all the pieces together on this one, finally, and I now understand exactly what is up: Facebook has rewritten the PHP runtime from scratch. Look if it's true, this is cool, it will no doubt be a great contribution to the OS world, but let's wait until Tuesday or until we have more concrete info beyond this author's guess that FB has completely rewritten the PHP runtime. I realize the author has little to gain from making this up, except for maybe 15 min of fame on HN, but still, don't believe everything you read.
- deleted 17y ago[deleted]
- timdorr 17y agoThis is particularly interesting because PHP's runtime was rewritten for 5.1 back in late-2005 (on top of 5.0's Zend Engine 2.0 improvements in mid-2004). And is PHP really considered "pokey"? Sounds like this guy is making stuff up because I get execution times of >0.01 seconds on my micro-framework.
- nir 17y agoWell, with quotes like "it is simply not a language designed for the sorts of workloads that Java and .NET are" I'm not sure of the author's technical level. Also, his comparison of Zend's "folks" (which ones? Founders? Execs? Sales people?) to "gestapo officer looking for a spy: "What? Who said that? Who said it was slow? Tell us their name!"" isn't too apt - they'd probably like to know who complained about PHP performance, so they can offer them their products/services, rather than silence them somehow.
- tapostrophemo 17y agoI'm curious; is this (http://timdorr.com/archives/2005/12/pgf-the-ease-of.php http://timdorr.com/archives/2005/12/pgf-the-ease-of.php) the micro-framework of which you speak?
- timdorr 17y agoNope, that's an older version of it: http://github.com/timdorr/asoworx http://github.com/timdorr/asoworx
- 17y ago
- kaens 17y agoI think that someone reimplementing PHP and cleaning up a lot of it's . . . quirks . . . could be a very good thing for the web. Someone who didn't care about maintaining backwards compatibility with code that relies on those . . . quirks . . . and who did care about language design, and clean implementation. Unfortunately, I have this sinking feeling that this is not going to be that.