7 ms·
The future of PHP, at a distance
- jtreminio 13y agoFrom my understanding, if the day ever comes where the official PHP engine is switched to HHVM, it would catapult performance past Python and Ruby in pretty much all scenarios.
- astrodust 13y agoVersus native Python and Ruby, perhaps. Versus PyPy and Ruby Motion? Probably not.
- untothebreach 13y agoI think what the parent comment meant was that the "official" PHP would catapult past the "official" python & ruby.
- codygman 13y agoI believe the correct way to refer to them is not "official", but "reference". The reasoning for this being that most languages encourage others to implement a compiler/interpreter.
- MichaelGG 13y agoDoes HHVM get massive gains for "normal" PHP code? I remember reading something about FB's early efforts, and there were strict guidelines about proper usage and whatnot. I have no idea how "good" "normal" PHP code is written compared to Ruby/Python.
- NickSharp 13y agoWe tried HHVM for use with our "normal" PHP. There was a measurable performance increase, but it was disappointing overall. Perhaps my initial hopes were too high. Our company is small and engineering/ops resources are very limited, leading to a lot of pragmatic decisions. After a few days of experimentation, I decided that HHVM was promising, but for us it's not yet worth the extra ops infrastructure. We get much bigger improvements tuning other pieces of our stack.
- dubcanada 13y agoIt works for Wordpress and Drupal, and those contain 90% of PHP functions. I mean there are times you will find issues or what not, but for the most part it's pretty good.
- memracom 13y agoPredicting the future is risky. HHVM exists. You can benchmark it against Python and Ruby today. What are the results? In any case, Python has things like cx_freeze that can be used to make apps close to compiled performance. And Python is not a single monolithic implementation. IronPython running on .NET for instance. PyPy has a VM with JIT. In any case, few people these days are worried about raw performance of apps. There are easier things to fix with page load times, getting rid of resource locking, and so on. HHVM will extend PHP's useful lifetime but outside of Facebook, Drupal-based sites, and WordPress-based sites, I don't see it growing in any significant way.
- jiggy2011 13y agoIf you add up Facebook + Drupal + Wordpress you probably come to a large % of total worldwide pageviews.
- LBarret 13y agocx_freeze just package python apps so you can distribute them like native apps, that is without requiring the installation of the python interpreter. It doesn't impact performance. Performance oriented pythonners go with pypy, numpy, cython, numba, etc. Each of them gives a very significant speed boost.
- InclinedPlane 13y agoI find that under most circumstances php-fpm and nginx is already enormously snappy and resource miserly, especially compared to rails. That's just anecdotal but I've seen the same thing in a lot of places. Performance wise PHP is in a pretty reasonable state except at scales that only a few companies in the world have to worry about.
- e-tron 13y ago"official PHP engine is switched to HHVM, it would catapult performance past Python and Ruby in pretty much all scenario" <-- official php performs faster than ruby/python anyway!!
- lkrubner 13y agoI think this is very true: "There were a bunch of old devs opposed to adding this documented "processes", saying that "open source is about fun and processes kill the fun". But to me that was always shining through that argument was that there is always an implicit process and that process is usually ideal for the current people "in power"." Jo Freeman has an essay called "The Tyranny of Structurelessness" which focused on how this issue (lack of explicit process) played out in left-wing political movements in the 1970s, and she does a great job of explaining how the lack of explicit process allows those with implicit power to keep control of things. http://www.bopsecrets.org/CF/structurelessness.htm http://www.bopsecrets.org/CF/structurelessness.htm "Contrary to what we would like to believe, there is no such thing as a “structureless” group. Any group of people of whatever nature that comes together for any length of time for any purpose will inevitably structure itself in some fashion. The structure may be flexible; it may vary over time; it may evenly or unevenly distribute tasks, power and resources over the members of the group. But it will be formed regardless of the abilities, personalities, or intentions of the people involved. The very fact that we are individuals, with different talents, predispositions, and backgrounds, makes this inevitable. Only if we refused to relate or interact on any basis whatsoever could we approximate structurelessness — and that is not the nature of a human group."
- purephase 13y agoNot at all related to the post and/or content, but that domain name is awesome.
- Aqwis 13y agoIn what universe does Python and Ruby's alternative implementations have significant market share?
- dragonwriter 13y agoIn the real universe we live in, JRuby, at least, has fairly wide adoption, and YARV, which started out as one of the alternative implementations, became the mainline implementation (and, at least for a while, it was widely speculated the same thing would eventually happen with Rubinius.)
- anonyfox 13y agoThe only advantage of using PHP in my eyes is: incredible cheap and hassle-free hosting for beginners. If you change something when introducing HHVM to the masses, then you would have a game-breaker. If you can afford/achieve anything better than "drag'n'drop" your "index.php" there, and open your browser to "test if it works", do it. Except, of course, you have to maintain tons of legacy stuff already written in PHP.
- Keyframe 13y agoI can give you two more advantages. Lots of know-how available and lots of developers to pool from.
- mathgladiator 13y agoAnother: it's really-really easy. I've built frameworks, done ruby, django, prior to my Java days. And, wow, php is just sooo easy to iterate and play with.
- coldtea 13y ago>The only advantage of using PHP in my eyes is: incredible cheap and hassle-free hosting for beginners. Well, clearly the engineers working on Facebook's PHP (and several other large projects, from Yahoo! to Wordpress.com) aren't "begineers" neither looking for "cheap, hassle-free hosting". I don't buy the "it's so crap, it's ONLY used because of cheap hosting" argument. It's also a pragmatic language, with tons of libraries and features for web use. So, it might be far from perfect, but than again, Javascript is far from perfect too, C++ is also flawed and Java has tons of bad decisions in its design (and culture). Still, those are some of the more widely used languages.
- anonyfox 13y agoFacebook just can't "switch" their backend. The mountain of built PHP stuff, including HHVM, is just too big to give up. They're of course not the typical beginners, but it's really easy to "get shit done" in PHP, so it happened that they used PHP when it all exploded in popularity, and mostly had to think on how to scale a running system massively, and not to rewrite everything from scratch again. On the libraries side: compare with javascript... all the NPM stuff and frameworks out there, and all the clientside-libraries in addition (think alone jQuery plugins). There is much crap in the JS-Land, but the sheer amount beats PHP clearly i'd say. Or take the JVM: the VM is a masterpiece of engineering/programming and has a lot of libraries availably, not only for web stuff, and supports many languages on top of it. Or, if you have some experience in the .NET world and know your visual studio, you can literally drag'n'drop your website together out of layouts and components. So far you can't share PHP code seamlessly between server & client (-> JS), your runtime doesn't run quite everywhere and allows you to use the language you like (-> JVM) or is preinstalled on every windows system today and has an excellent visual development tool (-> .NET). Yes, every language and ecosystem has it's flaws, but mostly they have also some single strengths that outweight the disadvantages. When you must nail down what PHP's is: I say incredible cheap hosting, and tons of legacy stuff (ironically often dropped on shitty cheap hosting platforms). You may find more stuff pro/con for all the samples i mentioned above, but i hope you understand the core problem.
- Fuxy 13y agoKinda wish they would drop backwards compatibility once in a while. I get why they don't but that's why PHP is just the most popular mediocre language. There should be scheduled non backwards compatible releases for every language (say every 10 years) that's the only way they can improve and not just get replaced when better ones come along.
- frenchy 13y agoPython did that, and now everyone loves to hate it.
- Fuxy 13y agoI like Python3. They fixed all the inconsistencies in the language. Sucks that some people are still stuck with 2.7 but it's definitely worth upgrading if you can.
- mrweasel 13y agoI don't think that developers hated Python 3. They hated to having to rewrite/fix a ton of 3. party modules. For a long time the improvements in Python 3 simply wasn't worth the hassle of dealing with incompatibilities.
- anonymoushn 13y agoLua does it very frequently, and people generally don't get quite as upset about it. The popular LuaJIT compiler and interpreter even implements a language that is somewhere between Lua 5.1 or Lua 5.2 without matching either exactly.
- pg_is_a_butt 13y agoPHP deprecates features all the time... you're an idiot.
- Fuxy 13y agoNot the same thing. PHP needs a total makeover not some minor tweaks. And you're very rude please go away.
- pg_is_a_butt 13y agogoogle app engine now supports PHP and they completely reimplemented the language. it is extremely fast and seems to already do all the things this story eludes might happen.... they already have.
- kodablah 13y agoThey did not completely reimplement the language, it appears to be the standard implementation. Compare https://github.com/GoogleCloudPlatform/appengine-php/tree/master/php-src https://github.com/GoogleCloudPlatform/appengine-php/tree/ma... to https://github.com/php/php-src https://github.com/php/php-src
- kodablah 13y ago"Also what about windows users, still a very significant portion of the PHP user base?" Yes, especially during development. I am toying w/ a PHP implementation on top of luajit, written in PHP so it may be more hackable and bootstrapped. The real problem is PHP fails to define a specification that implementations can follow (though they probably weren't prepared for the current situation). Sadly the runtime becomes the spec, and with such a large standard library, it's hard to predict what happens in dynamic languages when you send in something undocumented. In order to work w/ the myriad of PHP projects out there, unfortunately you have to mimic the undefined aspects. We are headed towards a more fragmented PHP than we already have. I've had enough problems changing PHP versions (regressions and undefined standard function changes), now with HHVM, you will have one more fragmentation piece. I'm all for different implementations. The saving grace I've found is all the language phpt files (but doesn't help w/ parsing and many compile-time errors).
- frik 13y agoDo you have a blog, or do you intend to put it on Github? A PHP parser written in PHP that generates bytecode for LuaJIT or HHVM's JIT-runtime would be cool. I was thinking about this too. And it would be fun to hack around :) FB's HHVM JIT and its bytecode format "hhir" is explained is the following recent blog post: http://www.hhvm.com/blog/2027/faster-and-cheaper-the-evolution-of-the-hhvm-jit http://www.hhvm.com/blog/2027/faster-and-cheaper-the-evoluti... LuaJIT2 and DynASM: http://luajit.org/ http://luajit.org/ [edit:] I found your repo: https://github.com/cretz/meh https://github.com/cretz/meh ...interesting, I am reading the code atm
- 8ig8 13y agoPHP related: Sensio Labs (Symfony) announced a $7 million investment yesterday: https://sensiolabs.com/en/a_propos/communique_de_presse_funds.html https://sensiolabs.com/en/a_propos/communique_de_presse_fund... More here: http://fabien.potencier.org/article/71/sensiolabs-raises-5-million-euros-to-boost-the-symfony-ecosystem http://fabien.potencier.org/article/71/sensiolabs-raises-5-m...
- jamesmoss 13y agoThe latest HHVM update has seen CPU usage reduced by 20% across Facebook. I wonder how many thousands of servers that works out to.
- e-tron 13y agobefore bashing php about perfomance(to python ruby users).. Lets have some data. for python users (http://benchmarksgame.alioth.debian.org/u32/benchmark.php?test=all&lang=php&lang2=python3&data=u32 http://benchmarksgame.alioth.debian.org/u32/benchmark.php?te...) for ruby users {http://benchmarksgame.alioth.debian.org/u32/benchmark.php?test=all&lang=php&lang2=yarv&data=u32 http://benchmarksgame.alioth.debian.org/u32/benchmark.php?te...}