Slashdot Mirror


Facebook Releases JIT PHP Compiler

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.

67 of 244 comments (clear)

  1. First PHP post by PCM2 · · Score: 5, Funny

    I'd like to launch this discussion by making a snide remark about PHP.

    --
    Breakfast served all day!
    1. Re:First PHP post by Roachie · · Score: 2

      Yea, perhaps Facebook can now develop a tool for REAL programmers!

      --
      This sig is not paradoxical or ironic.
    2. Re:First PHP post by Anonymous Coward · · Score: 5, Funny

      Aren't Facebook programmers already tools?

    3. Re:First PHP post by MattW · · Score: 5, Funny

      It's too bad PHP doesn't scale.

    4. Re:First PHP post by ohnocitizen · · Score: 2

      Great, along with all the other evils Facebook has perpetuated on the net, they've now made php more powerful and potentially more popular. They might as well give Darth Vader a perm.

    5. Re:First PHP post by man_of_mr_e · · Score: 2

      What's ironic is that if Facebooks development team spent half the amount of time they spend trying to make PHP perform well enough for them, writing code in a more conformant language.. they'd be done already.

    6. Re:First PHP post by f0rk · · Score: 2, Insightful

      (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).

    7. Re:First PHP post by icebraining · · Score: 2

      PHP is the opposite of a simple language. It was simple in the 3.X versions, but nowadays it has too much crap accrued. If you want a simple language, try Lua.

    8. Re:First PHP post by TheRaven64 · · Score: 2

      Or Smalltalk. And if you want Smalltalk to scale, VMWare bought Gemstone fairly recently and will sell you a deployment where you can have as many Smalltalk images as you want all using transactional memory to share state and happily scaling to a few million concurrent instances without any significant effort.

      --
      I am TheRaven on Soylent News
  2. Yo Dawgs! by syousef · · Score: 3, Funny

    Da Hip Hop PHP compila is in Da House! Respect bitches!

    --
    These posts express my own personal views, not those of my employer
    1. Re:Yo Dawgs! by binarylarry · · Score: 3, Funny

      Yo dawg I heard you like PHP, so we put an optimizing JIT compiler in your PHP runtime, so you can execute PHP code while you execute PHP code!

      --
      Mod me down, my New Earth Global Warmingist friends!
    2. Re:Yo Dawgs! by syousef · · Score: 2, Funny

      Yo dawg I heard you like PHP, so we put an optimizing JIT compiler in your PHP runtime, so you can execute PHP code while you execute PHP code!

      Yo mama executes unoptimized PHP!

      --
      These posts express my own personal views, not those of my employer
    3. Re:Yo Dawgs! by MrEricSir · · Score: 5, Funny

      Yo dawg I heard you like interpreting PHP code, so we put an eval() function in PHP so you can interpret PHP while you interpret PHP!

      --
      There's no -1 for "I don't get it."
    4. Re:Yo Dawgs! by iluvcapra · · Score: 5, Funny

      Yo mama's so fat, she thinks strstr(needle, haystack) and strstr(haystack, needle) both sound delicious, she just can't ever remember which one is the one to use.

      Yo mama's so fat, she hides food in $a[1] and $a["1"].

      Yo mama's so fat, she silently coerces strings into sandwich, and when the interpreter complains, she puts an @ sign in front of it.

      --
      Don't blame me, I voted for Baltar.
  3. much more traditional solution by Trepidity · · Score: 2

    Interesting that they've settled on this approach, which in some ways is much more traditional: developing a high-performance JIT for a dynamic language instead of trying to statically compile a subset. Basically the approach taken by StrongTalk, V8, PyPy, Rubinius, etc.

    1. Re:much more traditional solution by loufoque · · Score: 2

      Statically compiling a subset would yield much better results, but would be significantly harder to do.

      They took the easy way out; this is not a compiler any more than the reference implementation is. It's just a replacement for the reference implementation that sucks a bit less in terms of performance.

  4. Re:Mixed feelings by yelvington · · Score: 5, Insightful

    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.

  5. Is it open sourced? by Taco+Cowboy · · Score: 4, Insightful

    Is FB's JIT PHP open sourced?

    --
    Muchas Gracias, Señor Edward Snowden !
    1. Re:Is it open sourced? by PCM2 · · Score: 5, Informative

      Is FB's JIT PHP open sourced?

      It appears to be licensed under a combination of the PHP license and the Zend license. Both are BSD-like, but the Zend license has a clause that requires you to advertise for Zend if you advertise for a product built with the Zend Engine, which I don't much care for.

      --
      Breakfast served all day!
    2. Re:Is it open sourced? by Anonymous Coward · · Score: 5, Informative

      If it's not, back to Xcache or APC.

      Their "10 times figure" is absolutely correct though, in both Xcache and APC, the compiled binaries to take up 10 times as much space on disk and/or in memory, but to put things in perspective, that's caching memory. It was already consuming that 10 times size when being run directly from php before.

      Memory pigs like wordpress eat like 64MB of memory before you even get to plugins. Memory deduplication is required if you are running multiple blogs because the cache files generated by things like SuperCache and MaxCDN also eat up the opcode cache space.

      Fun times.

      #1 rule of php memory management: NEVER inline html. Many people use it as a easy way to do SSI, but this eats memory, opcode cache or not.

    3. Re:Is it open sourced? by nzac · · Score: 4, Informative

      Its on github and depends on open-source libraries.

      from the github page:

      HipHop is licensed under the PHP and Zend licenses except as otherwise noted.

      Its opens source but not copyleft/gpl and if you want to contribute to the project i think you have to sign over the copyright (need facebook login to see the agreement).

    4. Re:Is it open sourced? by Rennt · · Score: 2

      Yes. Code is up on github, a link to it cleverly hidden right there in the summary.

    5. Re:Is it open sourced? by ksd1337 · · Score: 5, Funny

      Hey, he's got a 4-digit UID! Respect your elders!

    6. Re:Is it open sourced? by interval1066 · · Score: 2

      Hey, say what you want about fb, this news is a net Good Thing(tm). Its not bad that they add to the community and add something useful. And a JIT for php is a good thing.

      --
      Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
    7. Re:Is it open sourced? by PCM2 · · Score: 4, Interesting

      The Zend Engine license seems contradictory to me. On the one hand, Clause 3 says you're forbidden from using the terms "Zend" or "Zend Engine" to endorse or promote your product. On the other hand, Clauses 5 and 6 say you're absolutely required to use the term "Zend Engine" to endorse and promote your product. Seems like someone took the classic BSD license and bolted a commercial land grab onto it, which seems to honor neither the letter nor the spirit of the original.

      --
      Breakfast served all day!
    8. Re:Is it open sourced? by youn · · Score: 4, Funny

      I believe it is a license meant for quantic processors... it is required and not required at the same time

      --
      Never antropomorphize computers, they do not like that :p
    9. Re:Is it open sourced? by MightyMartian · · Score: 2

      A good thing for the "community" would be if the library was cleaned up. Speeding up a trainwreck only makes the end result that much more catastrophic.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    10. Re:Is it open sourced? by Tom · · Score: 5, Funny

      Pffft. Newbie.

      --
      Assorted stuff I do sometimes: Lemuria.org
    11. Re:Is it open sourced? by TheRaven64 · · Score: 3, Insightful

      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'.

      --
      I am TheRaven on Soylent News
    12. Re:Is it open sourced? by truthsearch · · Score: 2

      it makes it easy to write huge spaghetti projects that are expensive to maintain

      What language doesn't? Blaming PHP for poorly written code is like blaming a car for having a bad driver.

  6. Re:Mixed feelings by Etz+Haim · · Score: 3, Insightful

    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.

  7. Re:Mixed feelings by vinng86 · · Score: 5, Insightful

    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.

  8. Re:Mixed feelings by John+Courtland · · Score: 4, Insightful
    Bullshit. PHP's standard library is a piece of shit that certainly promotes bad coding practices. Case in point: http://us3.php.net/manual/en/function.implode.php

    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.

    --
    Slashdot is proof that Sturgeon's Law applies to mankind.
  9. Re:Mixed feelings by InsightIn140Bytes · · Score: 4, Insightful

    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.

  10. What's your problem? Very well documented! by syousef · · Score: 5, Funny

    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.

    What is your problem with this exactly? The functions do exactly what their name suggests. They will either make your head implode or explode!

    --
    These posts express my own personal views, not those of my employer
  11. Re:So True. by Jack9 · · Score: 4, Insightful
    --

    Often wrong but never in doubt.
    I am Jack9.
    Everyone knows me.
  12. Re:Mixed feelings by CodeReign · · Score: 5, Funny

    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.

  13. I hate all languages that start with P by Maltheus · · Score: 2, Funny

    They're just not maintainable in my experience.

    1. Re:I hate all languages that start with P by gregfortune · · Score: 2

      It's ironic how close P and R happen to be. Ruby fan, I take it?

      If not Ruby, what do you use for a scripting language? Please don't tell me you decided long ago that if it's possible to do everything in assembly, it must be done in assembly.

  14. Re:So True. by Rennt · · Score: 4, Funny

    It's a form of hacker koan. In your eagerness to be a smartass you failed to reach enlightenment.

  15. Re:Mixed feelings by Anonymous Coward · · Score: 5, Insightful

    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.

  16. Re:Mixed feelings by InsightIn140Bytes · · Score: 5, Insightful

    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".

  17. Re:Mixed feelings by binarylarry · · Score: 2

    Let me fix that for you:

    ...and PHP is the choice of tools!

    --
    Mod me down, my New Earth Global Warmingist friends!
  18. Re:Mixed feelings by MightyMartian · · Score: 5, Informative

    PHP is like BASIC. In the right hands it can certainly produce just as readable and maintainable code as any other language, but the short learning curve to get to first base invites people with little or no discipline, or often enough, without any underpinnings at all, to write absolute garbage. Worse, this code often ends up being the core of some important infrastructure, and then some poor yob (I was one for several months) has the unlucky job of trying to maintain this garbage. And because the php.ini file allows you turn on all the worst aspects of the language, you end up having to do just that just to keep the damned code running while you try to clean it up.

    Oh yes, and apart from the issues I have with the language itself, it has just a plain awful library, with inconsistencies throughout that mean I spend as much time perusing the docs as I do actually coding anything.

    Between these two factors, I have to say I hate PHP, but still find myself all too often being forced to deal with it.

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
  19. Real PHP Compiler by kervin · · Score: 2

    You can find a real PHP compiler at http://phpcompiler.org/. It would be nice if the official PHP engine had built in support for loading and running bytecode ( like JVMs ) instead of strictly text code.

    1. Re:Real PHP Compiler by cshark · · Score: 2

      Yes, but it's non standard. With Phlanger, you're mixing old extensions with known threading and security bugs with a weird namespace format, and an incomplete implementation. Then there's Studio integration, which is spotty. Didn't even support Studio 10 last I checked. If by "real" you mean, "runs half ass on .net" you're right. In terms of maturity, and in most other respects, it can't touch hiphop. Seriously man, try hiphop. It's amazing.

      --

      This signature has Super Cow Powers

  20. Re:Mixed feelings by MightyMartian · · Score: 4, Insightful

    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.

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
  21. dev only by Fnord666 · · Score: 3, Insightful

    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.

    --
    'The tyrant will always find pretext for his tyranny.' - Aesop's Fables
  22. Re:Mixed feelings by shutdown+-p+now · · Score: 3, Insightful

    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 mess...no, hacking doesn't have much to do with it.

  23. Re:Mixed feelings by shutdown+-p+now · · Score: 2

    Mixed mode is the least of PHP troubles as a language. It's things like silently converting strings to numbers when used as keys of associative arrays that really makes it so irksome .

  24. Re:Mixed feelings by garyebickford · · Score: 4, Insightful

    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

    --
    It's easier to be a result of the past, but more fun to be a cause of the future! http://www.spacefinancegroup.com/
  25. Re:Its not really JIT is it? by PCM2 · · Score: 2

    I think the Readme on GitHub is a placeholder. They took the Readme from HipHop, aka hphpc, which was the earlier project. This is HipHop VM, which is something different. Read the "more technical description," linked at the top, to get the picture. Basically, HipHop goes PHP-->Abstract Syntax Tree-->C++-->x64. HipHop VM goes PHP-->AST-->Bytecode, then runs the bytecode through a JIT.

    --
    Breakfast served all day!
  26. Re:So True. by garyebickford · · Score: 2

    I generally extend to the third ninety - the last 1% of the code take the third ninety percent of the time. This is a pretty good model for the difference between a good, working program and one with a shiny user interface and most of the beta-bugs worked out.

    Or, as someone I worked with who had been at BBN working on the original ARPAnet said, "Take whatever schedule the engineers give you, double it and convert to the next higher units." (two weeks => four months, etc.)

    --
    It's easier to be a result of the past, but more fun to be a cause of the future! http://www.spacefinancegroup.com/
  27. Re:Mixed feelings by trawg · · Score: 5, Interesting

    I disagree that it promotes bad coding practices. I read that as a bit of a tongue-in-cheek comment that actually encourages people to use it the right way, while at the same time drawing attention to the fact that you can swap parameters and you might get unexpected results (i.e., the function working even though it should throw some sort of type error).

    Sometimes mistakes are made in libraries and terrible ugly hacks have to be made to work around them so as not to destroy many hours of work. Whether or not PHP has its share doesn't mean the blame for writing terrible code should be laid entirely at its doorstep.

    Certainly a few crappy library functions hasn't soured Facebook on PHP; I for one am glad to see their continued investment in it and - more importantly - their continued practice of open sourcing new and innovative ways of dealing with PHP.

  28. Re:Mixed feelings by Mad+Merlin · · Score: 2

    PHP is like BASIC. In the right hands it can certainly produce just as readable and maintainable code as any other language, but the short learning curve to get to first base invites people with little or no discipline, or often enough, without any underpinnings at all, to write absolute garbage.

    Would you you prefer that said people stumble their way through something more difficult like C, so that they can produce even worse code than they would have in PHP?

  29. Re:So True. by PCM2 · · Score: 4, Interesting

    Which is at least 50% slower on its best day, than C/C++ on it's worst day.

    Got any numbers to back that up, or are you just pulling it out of thin air?

    It's the VM part that kills performance. The Java VM, and presumably, the PHP VM, do not execute native machine instructions, but instead, use an intermediary format, as opposed to, native cpu instructions.

    You don't seem to understand how a JIT works. Many portions of Java programs are indeed executed as native machine instructions.

    Combine that with the remarkable similarity between PHP syntax and C ( but without the speed )

    I wouldn't call the similarity "remarkable." "Superficial" might be a word I'd use, in the sense that Java syntax is also similar to C.

    --
    Breakfast served all day!
  30. Re:Mixed feelings by Zero__Kelvin · · Score: 2

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

    True; people who don't know how to design software and think that you start creating a solution by programming create programming messes. Programming languages encourage design messes, though. PHP is a programming mess waiting to happen because it attracts people who think that step one is to start coding.

    --
    Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
  31. Re:Mixed feelings by Zero__Kelvin · · Score: 5, Funny

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

    FTFY.

    People who use the wrong tool when the right tool is available are called PHP programmers ;-)

    --
    Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
  32. Re:Mixed feelings by haknick · · Score: 2

    Great writeup. I really don't know if ppl writing here have ever programmed a real project in PHP. Check out Concrete5 and reply with a better, cleaner, faster to build modules/plugins for, more extendable open source CMS in any other language. Let's see what competition is out there. Only a month ago we finished a very similar proprietary system that is so much better than say Apache Roller (which I had prior experience), it's not even funny. Now, obviously there are certain things that PHP is just not good at because there simply wasn't any pushing in certain areas. Scala's continuations are one such thing that I really need recently and PHP is just the wrong tool for. Obviously I'm using Scala for it and the turnaround was pretty quick too (especially considering how much more complex thinking Scala requires).

  33. Re:Mixed feelings by cshark · · Score: 5, Interesting

    You know, you hear that kind of weird argument a lot from people who don't realize they've been framework programming on Microsoft platforms. They are always complaining about how primitive PHP is because it doesn't have any "built in" separation between the various heavily abstracted but highly arbitrary layers, and that they don't understand the way PHP abstracts logic, variable classes, magic methods, lambada syntax, etc. They're always pointing to perceived shortcomings in PHP, like the one data interchange layer they know about, or the fact that PHP doesn't pass complete classes as strings. The list goes on for fucking ever. The intentional ignorance of these people annoys the holy shit out of me. Or, well... it used to.

    You know, by the same criteria these "evangelist" idiots are using to judge PHP, and failing to apply their idea of "modern", they would be sorely disappointed with any number of other languages. PHP is C++ script. Plane and simple. So if you hate PHP, or you simply can't bring yourself to understand it, it's fair to assume you wouldn't like like C++ either. And for that matter, you certainly wouldn't enjoy Perl, any version of C (other than the sharp kind), Python, Ruby, Java, or any other modern language not developed by our friends in Redmond. None of them would be "modern" enough for you. Or maybe, you're just not skilled enough at your chosen craft. Nobody will ever appreciate the artist who refused to paint because he didn't like the brushes.

    PHP isn't the only language that people have written mountains of bad code on either. If you could even begin to understand the mountain of truly nightmarishly bad .net code I've had to wade through over the last decade, you would give me a fucking medal. In fact, I would wager to say that it's easier to write a large, poorly architected application in C# than it is to write one in PHP. Why? Easy. Because Visual Studio doesn't require you to actually think a whole hell of a lot about what you're coding.

    When you write something in PHP, it's a direct reflection of your ability to code. That's all it is. Code. Start to finish. You think out a problem, and then you write the code to do it. If you want to seperate it into objects, classes, or layers, you're entitled to. If you have another way to do it, that's also fine.

    PHP gives you absolute control and power over whatever it is you want to create. If you're not used to it, or ready for that kind of responsability, it can be frightening.

    So I totally understand why lesser programmers hate it.
    Personally, I like having options.

    --

    This signature has Super Cow Powers

  34. Re:Mixed feelings by Lehk228 · · Score: 2

    no, they would release it and call it "Windows 95"

    --
    Snowden and Manning are heroes.
  35. Re:Mixed feelings by aztracker1 · · Score: 3, Interesting

    Honestly the syntax of the language doesn't bug me nearly so much as the inconsistancy_in TheApi andItsCommonLibraries. Some use pointers/handles as psuedo classes, or just plain poorly conceived and inconsistent string and array handling. I know there are frameworks on top of PHP that sterilize a lot of this, it just feels like building a house on sand. There are honestly very few web frameworks I really like, and I've worked with many of them. C# + MVC is a fav, but I've seen some wretched code in C# as well. Usually derived from "software architects" who will abstract everything out ad infinitum and sometimes to no point at all. I'm all for IoC and other abstractions and models when they serve a purpose. when you only need 5-10 method calls for a very simple web-app, it's overkill.

    C#'s greatest downfall is those developers/architects that will over-engineer what can be a simple system. PHP's greatest downfall is the sheer popularity in un-trained, or ill-thinking programmers that give the same level of bad taste VB did in the 90's for a lot of people. Bad code can indeed be written in any language, but when a language's core functionality is so poorly conceived, it's harder to write good code. For the record, not very fond of C/C++, but do like Perl okay (for text processing).

    --
    Michael J. Ryan - tracker1.info
  36. Re:Mixed feelings by mcrbids · · Score: 5, Insightful

    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.

    --
    I have no problem with your religion until you decide it's reason to deprive others of the truth.
  37. Re:Mixed feelings by dingen · · Score: 3, Informative

    The language changes too rapidly

    Erm... what? Have you actually looked at the changelog in the past few years? It's all bug fixes, there's absolutely nothing interesting going on there! Development in PHP has completely stagnated for years now. PHP 5.2 was released in 2006 (!!!) and still not everybody has caught on. Then 5.3 came out 3 years later, but it's even rarer to encounter that in the wild. The differences are totally marginal and the stuff they're deprecating is mainly bad stuff from PHP3 and PHP4 that you shouldn't have been using in anything for the last couple of years anyway.

    There's a lot wrong with PHP and there's a lot of bad stuff in there, but in my opinion the worst thing about PHP is the lack of progress to improve things. So no, I don't agree the language changes too rapidly, I think it's changing not nearly rapid enough.

    --
    Pretty good is actually pretty bad.
  38. Re:Mixed feelings by Xest · · Score: 2

    "Yeah cause PHP is so bad Facebook use it..."

    Yes, for historic reasons.

    But look at this very fucking article, they've basically just turned it into Java. That is of course, after they wrote something to turn it into C++ previously.

    Which proves the point, that for something large scale and scalable to this degree, then something like C++ or Java from the outset is the best tool for the job. PHP as is has clearly failed to meet Facebook's needs, hence why they've spent the whole year bastardising it into something else by replacing the translator altogether.

    If they didn't have so much existing PHP code or could simply throw their existing codebase away, you could guarantee this story would've instead been "Facebook ditches PHP".

  39. Re:So True. by daid303 · · Score: 2

    He asked for numbers.

    And I got numbers for you, from PyPy (Python JIT), showing that PyPy is faster then C in some cases.
    http://morepypy.blogspot.com/2011/08/pypy-is-faster-than-c-again-string.html

  40. Re:Mixed feelings by icebraining · · Score: 2

    dynamic typing means that in the right contexts, 1==0

    That's not a fault of dynamic typing. The problem with PHP is that it's weakly typed. You can have dynamic but strong typing, e.g. Smalltalk, Python, Ruby, etc.