Please create an account to participate in the Slashdot moderation system


Forgot your password?
Facebook PHP Programming

Facebook Releases JIT PHP Compiler 244

angry tapir writes, quoting a Techworld article: "In its continuing endeavor to serve its 800 million users as quickly as possible, Facebook is once again revamping the way it handles its PHP-based Web pages. Facebook has posted ... its HipHop Virtual Machine (HHVM), which the company's engineers call a just-in-time PHP compiler. According to Facebook, this PHP execution engine is 60 percent faster than its current PHP interpreter and uses 90 percent less memory." Facebook has a weblog post with a more technical description.
This discussion has been archived. No new comments can be posted.

Facebook Releases JIT PHP Compiler

Comments Filter:
  • Re:Mixed feelings (Score:5, Insightful)

    by yelvington ( 8169 ) on Monday December 12, 2011 @08:51PM (#38350422) Homepage

    That's a step forward for us who rely on crammed share hosting providers, but I strongly believe that PHP has to be phased out in favor of more recent techologies that enforce a clearer (eg DRY, separation of content and logic etc) way of thinking.

    Programming languages don't create programming messes. People do.

  • by Taco Cowboy ( 5327 ) on Monday December 12, 2011 @08:52PM (#38350432) Journal

    Is FB's JIT PHP open sourced?

  • Re:Mixed feelings (Score:3, Insightful)

    by Etz Haim ( 856183 ) on Monday December 12, 2011 @08:57PM (#38350456) Homepage
    I was expecting this. You could argue that, and also add to it that there are PHP frameworks out there that do DRY, MVC etc. The problem is that PHP itself, by allowing "mixed mode" scripts containing both HTML and PHP, teaches a programming paradigm that is unacceptable by modern standards.
  • Re:Mixed feelings (Score:5, Insightful)

    by vinng86 ( 1978262 ) on Monday December 12, 2011 @08:57PM (#38350458)
    You must be knew to programming. PHP is a language, not a framework. You can use a PHP framework to apply a MVC (model/view/controller) structure or you can choose not to. It's entirely up to the programmer, not the language.
  • Re:Mixed feelings (Score:4, Insightful)

    by John Courtland ( 585609 ) on Monday December 12, 2011 @08:58PM (#38350474)
    Bullshit. PHP's standard library is a piece of shit that certainly promotes bad coding practices. Case in point: []

    And I quote:

    implode() can, for historical reasons, accept its parameters in either order. For consistency with explode(), however, it may be less confusing to use the documented order of arguments.

  • Re:Mixed feelings (Score:5, Insightful)

    by InsightIn140Bytes ( 2522112 ) on Monday December 12, 2011 @08:59PM (#38350478)
    No it doesn't. It's entirely up to you how you use an programming language. It's good that PHP supports "mixed mode" and everything between. Hell, I've made IRC server with PHP along with desktop apps and everything else.
  • Re:So True. (Score:5, Insightful)

    by Jack9 ( 11421 ) on Monday December 12, 2011 @09:02PM (#38350512)
  • Re:Mixed feelings (Score:5, Insightful)

    by Anonymous Coward on Monday December 12, 2011 @09:20PM (#38350642)

    Yeah cause PHP is so bad Facebook use it... no programming language is perfect, they all have their quirks. But your comment is baseless, PHP doesn't make bad programmers, it just doesn't break your legs if you are one.

  • Re:Mixed feelings (Score:5, Insightful)

    by InsightIn140Bytes ( 2522112 ) on Monday December 12, 2011 @09:24PM (#38350666)

    You are a disgusting filth and I will loath the existence of people who don't use the right tool for the right job for the rest of my life.

    You know, people who do fancy stuff with not exactly the right tools were called "hackers".

  • Re:Mixed feelings (Score:5, Insightful)

    by MightyMartian ( 840721 ) on Monday December 12, 2011 @10:00PM (#38350954) Journal

    Which means it won't be. PHP has taken hold, and good, bad or ugly, we're stuck with it. There's no phasing it in anything like the short or even medium term. LAMP is everywhere, and countless sites are built on it. It's like COBOL, a bad dream that will keep terrifying us even as better languages flicker and die.

  • dev only (Score:4, Insightful)

    by Fnord666 ( 889225 ) on Monday December 12, 2011 @10:27PM (#38351140) Journal
    Unless I misunderstood the post, this is only being used in their development environments. It sounds like they are still using statically compiled php for production. They did mention that they hoped to closed they gap in performance between the two in the near future though.
  • Re:Mixed feelings (Score:4, Insightful)

    by shutdown -p now ( 807394 ) on Monday December 12, 2011 @10:37PM (#38351204) Journal

    You know, people who do fancy stuff with not exactly the right tools were called "hackers".

    Only when it's either hard to do so, or when doing that is some kind of a pun. When the only hallmark of such a work is that the result is a bloated, hacking doesn't have much to do with it.

  • Re:Mixed feelings (Score:5, Insightful)

    by garyebickford ( 222422 ) <> on Monday December 12, 2011 @10:49PM (#38351268)

    Ya know, about 30 years ago, that statement could have been written thusly:

    C programs are per se incompatible with the structured programming model. It's a bad programming practice and if you use it, you are doomed to repeat yourself.

    Your statement is pretty much equivalent to "never end a sentence with a preposition".

    Structured programming eventually failed to take over the world because it imposed too much artificial, restrictive structure. Back then I remarked that "structured programming" was merely a way to force all programs to fit on a flat two-dimensional surface with no crossing lines. Admittedly, such programs are easier to analyze, but are a tiny, tiny subset of the set of interesting and useful programs. For example, one can look at the entire internet as one rather large, complex, multithreaded program.

    MVC is a good model, but it ain't the be-all and end-all. All models are an attempt to impose an rational order on what is essentially a linguistic medium (with a veneer of logic). The languages that survive are those that allow the maximum flexibility, with enough support for the tools of analysis and good practice to allow programmers to succeed. C, for example, continues to succeed because it does not have such artificial constraints, but can be adapted to the constraints that the programmer (and the organization) considers important at the time. As a counterexample, see Pascal, or Algol. And don't forget Gõdel.

    So, use MVC and DRY. But one day you will find a situation where they get in the way of the most elegant solution. Or, more likely, they will get in the way of hacking a new feature into some legacy POS in time to meet the deadline that Marketing already promised to the client! :D

  • Re:Mixed feelings (Score:5, Insightful)

    by mcrbids ( 148650 ) on Tuesday December 13, 2011 @03:05AM (#38352594) Journal

    Certain, I'm going to get modded to oblivion for this, but....

    Brother I hear your music! PHP is highly underrated! It's a language flexible enough to allow you to just stick a date stamp in the middle of a random webpage, and also write a highly complex, object-oriented application framework with gorgeous abstractions.

    Performance is decent, sources are open and don't require compiling, and it's compatible with every webhost and platform out there. It scales well with it's "share nothing" approach, and is one of the most stable software packages I've ever seen. Oh, and the Documentation is excellent.

    Sure, it has it's warts: dynamic typing means that in the right contexts, 1==0, and a few others, but these are edge cases in every situation that matters. Most of the problems with OOP in PHP4 have been fixed with the now-almost-universal PHP5.

    I can do c, c++, Python, Perl, Javascript, Java, etc. but PHP is my favorite as the Chrysler K-car that doesn't win any looks contests, but always starts and gets you where you want to go, even if only at the legal speed limit.

  • Re:First PHP post (Score:2, Insightful)

    by f0rk ( 1328921 ) on Tuesday December 13, 2011 @04:59AM (#38353046)

    (as you are mod'ed Funny, I'm not entirely sure if your sarcastic or really unknowing)

    This is honestly one of the most idiotic and ignorant thing to say about PHP. PHP has it's quirks, and wierdnesses. But it's not any less of a language or platform then anything else.

    It did not have any special facilities or out-of-the-box features, prior to 5.3. But it has had FastCGI support for ages. It's honestly the only requirement you really want to scale PHP. You can deploy as many PHP workers as you like. Combined with a shared or replicated webroot and database, you have a really simple and SOLID scale path.

    Now when 5.3 is getting more and more deployed we also have PHP-FPM. A dedicated and officially supported process manager to pool and manage php workers. Just like FastCGI, it's architecture is super simple, and a blast to work with. One of the additions is "per pool php.ini", were you run the same instance of the manager but with entirely different PHP environments.

    Remember, the PHP philosophy has always been KISS, "Keep It Simple, Stupid". PHP in it self is just the language and runtime. Scaling is deliberately left outside of the core, and developed by people more skilled in that particular area. (Ok ok, its not entierly seperated from the core. PHP-FPM had some minor changes made to the 5.3 codebase to cater for their architecture).

  • by TheRaven64 ( 641858 ) on Tuesday December 13, 2011 @08:12AM (#38353718) Journal
    No, you must use your product to advertise theirs, you can't use theirs to advertise yours. It's the same as the old BSD license. You must include 'built using Zend's stuff' somewhere in your documentation, but you can't say 'really amazing because it uses Zend's stuff'.

e-credibility: the non-guaranteeable likelihood that the electronic data you're seeing is genuine rather than somebody's made-up crap. - Karl Lehenbauer