4 ms·
Interesting that so far most of the comments are pretty positive. Every time Facebook gives a HipHop talk at my university, it seems the general feeling in the
by RobAtticus 15y ago
Interesting that so far most of the comments are pretty positive. Every time Facebook gives a HipHop talk at my university, it seems the general feeling in the room is "ugh, why?" The PL people wonder why they're bothering with such a broken language, and other language zealots get angry that they aren't using [insert-favorite-language-here].
I wonder if there is a point where they can't squeeze anything more out of HipHop and have to do a drastic rewrite.
- pyman 15y agoWhy? HipHop is already faster than your Dad's fancy sport car.
- hvs 15y agoThe thing is, when they can't squeeze any more out of HipHop, the last thing they are likely to do is use one of those [insert-favorite-language-here], because HipHop will be so much faster than any implementation of those other languages. An important point to remember is that languages, as interesting as they are, are simply means to translate ideas into machine code. If they translate it into really fast machine code, it doesn't really matter that much (except academically) how "correct" the language is. I do not enjoy writing in PHP, but I have a lot of respect for the real world work that Facebook is doing with it.
- jrockway 15y agoIf you want fast, why would you use PHP and then write a new VM, when you could just use Java or Common Lisp or Haskell or C? Those already exist and are already damn fast.
- RobAtticus 15y agoThe explanation they seem to give is there are a lot of people who can write PHP, and can write PHP code very fast. So because PHP allows their engineers to iterate and prototype new features very quickly, any attempt to convert to a new language is thwarted when those writing in PHP are outproducing the conversion process that it'll never catch up. I'm not saying it's a great explanation, but it is what it is.
- jonknee 15y agoIf the people you find to write code aren't capable of learning something other than PHP, you should find new people. People who write code for Facebook should be good at programming, not just "good" at PHP.
- RobAtticus 15y agoBut the language itself is conducive to writing a lot of code rather quickly. There is no memory management to worry about, there isn't a bunch of verbose boiler plate like in Java. You just write code and even if it's not perfect, you can iterate on it quickly. That's not to say that's how I'd run Facebook given the opportunity, but from talking with people who have presented HipHop here, these are the reasons they give.
- pbiggar 15y agoMy understanding is that Facebook rarely hires PHP developers, it hires other developers and teaches them PHP. This bases on a conversation from 2009 when they had just 200 programmers, so this is likely to no longer be true. However, I think it's highly likely that Facebook developers know a lot more than PHP.
- pwaring 15y agoBecause you can get a web application up and running quickly in PHP, then tune it later if and when your application needs to scale to 500 million users (which it probably won't, because only a handful of sites reach that size). There's also a far bigger pool of talent to draw from if you want developers. I don't think there are many people who know how to write web applications in Common Lisp or Haskell.
- nupark2 15y agoI believe this is a fallacious argument; performance inefficient introduces significant costs at lower scales, too.
- SomeOtherGuy 15y ago>Because you can get a web application up and running quickly in PHP You can get a web app up and running quickly in good languages too, and then you also don't have ongoing maintenance nightmares and the massively increased hardware and hosting costs that come with PHP.
- pwaring 15y agoI don't know where you're getting this "massively increased hardware and hosting costs" from - we run our trading platform on bog standard x86_64 hardware, as has every other PHP site I've worked on (some even run in VMs with 500MB of memory).
- SomeOtherGuy 15y agoBecause you are buying 10 times as many servers, and paying for power for 10 times as many servers. Where on earth did this "bog standard x86_64 hardware" business come from?
- underwater 15y agoFacebook really doesn't care what languages new hires know. Only a small number of people I started with had any experience with PHP. Anyone who works here is capable of becoming proficient in the language during bootcamp (http://www.quora.com/How-does-Facebook-Engineerings-Bootcamp-program-work http://www.quora.com/How-does-Facebook-Engineerings-Bootcamp...).
- maratd 15y agoYou could also write your software in assembly and it'll be faster than all of those you mentioned. The point is to select a language that is feasible for a business. Facebook is not an academic exercise. PHP has a lower barrier to entry, which in practical terms reduces the wages that need to be paid. You then get a few guys who are great at C (PHP is written in C) and fix whatever parts are getting in the way of great performance. Which is exactly what Facebook is doing. Remember, Facebook is a business.
- jasonlotito 15y agoYou're getting downvoted by people who disagree with you, not because you aren't contributing to the discussion. I just wanted to make it clear that they are wrong for doing that, and that your comment, whether I agree or not, is appreciated.
- fleitz 15y agoFully agree, given the code base that exists the best ROI likely comes from improving execution speed of PHP rather than rewriting the codebase.
- jrockway 15y agoMaybe if it's a video decoder that uses special video decoding instructions. For real world code, though, a good JIT is going to make most code very fast, and you will actually be able to maintain it. I don't think Java is any harder to maintain than PHP, but it runs much faster. (I think Perl and Python are much easier to maintain, however, so if that was what we were arguing about, then it would make sense. PHP is objectively the worst "P" language.)
- maratd 15y agoYou're missing my point so completely that it becomes a fine example of why engineers make poor businessmen. The best business solution is the one that accomplishes the task at hand with the least resources. By that metric, PHP is far superior to Java, regardless of the technical merits at hand. It costs less to hire an army of PHP devs and a small team to optimize PHP, than it does to hire an army of Java developers. http://www.payscale.com/research/US/Job=PHP_Developer/Salary http://www.payscale.com/research/US/Job=PHP_Developer/Salary and http://www.payscale.com/research/US/Job=Java_Developer/Salary http://www.payscale.com/research/US/Job=Java_Developer/Salar... The difference in pay is around $20K. If you have 500 developers, that's a difference of $10 mil per year. Over the span of a decade, you're talking about over $100 million in savings. As I said, Facebook is a business, not a pet project or an academic exercise. Decisions on which platform to use and keep are made based on dollars and cents ... not on which is more elegant or technically superior.
- saucetenuto 15y agoIt's not like those requirements arose all at once; at first they wanted to get stuff done using tools they already knew. Then, somewhere north of a million LoC they were like "oh right, speed". At that point, it's no surprise that building a VM was cheaper than a full port.
- strlen 15y agoFacebook does use Java (entire Hadoop infrastructure, HBase deployments, likely more), Haskell (AST manipulation, afaik), OCaml (with a fairly interesting library for static analysis: https://github.com/facebook/pfff https://github.com/facebook/pfff ), C++, and C (fairly self explanatory).