r/lolphp • u/touch_hole • Sep 19 '17
HHVM dropping PHP
http://hhvm.com/blog/2017/09/18/the-future-of-hhvm.html17
u/deusex_ Sep 19 '17
How's this /r/lolphp?
13
u/hurenkind5 Sep 19 '17
Eh, one could count that as both lolphp and lolhhvm.
9
u/Synes_Godt_Om Sep 20 '17
Or the usual contrived, forced attempt at laughing at something that really isn't funny anymore.
lolphp was a good source of gotchas back in "5.3" days, but now? Not so much.
15
1
Sep 23 '17
Maybe.. Still Hack is a much more decent language to work with than PHP is. I think Hack dropping PHP is a good thing, now the language can grow without messing with the PHP core devs and their never ending madness.
33
Sep 19 '17
The long used reason for still using PHP...."but facebook uses it". Not anymore!
6
u/deusex_ Sep 19 '17
i think they took PHP where it was good for them but it never caught on massively
php7 is a whole different story than hhvm, another good one though
2
u/enchufadoo Sep 19 '17
But they weren't using it before this announcement.
6
u/mikeputerbaugh Sep 20 '17
They were (are) using Hack, which is for all intents and purposes a non-standard fork of the PHP language specification.
8
0
Sep 19 '17
[deleted]
6
u/Schmittfried Sep 19 '17
It is a good idea.
0
Sep 19 '17
[deleted]
4
u/Schmittfried Sep 19 '17
I don't see how it breaks MVC. It does not. It's just a template engine directly integrated into the language just like LINQ is SQL directly integrated into the language. This adds type safety and other safeguards that would usually be missing with an external template engine / ORM without language support. Neither XHP nor LINQ break solid architectural patterns. Adhering to those is up to the developer, not the tools he uses.
0
Sep 19 '17
[deleted]
3
u/fred_emmott Sep 21 '17
This is not how we use it internally; I'm not sure if it was at the time, or if this example was just structured like this to be more approachable in the context of a blog post.
Edit: https://github.com/hhvm/user-documentation/tree/master/src/site is a fair bit closer of an example to how we use it internally
3
u/fred_emmott Sep 21 '17
Though yes, we do use it in a way that breaks MVC; see the section on 'Asynchronous XHP' on https://code.facebook.com/posts/858739974205250/announcing-xhp-js-building-efficient-user-interface-components-with-hack-react-and-xhp/
TL;DR: we feel that encapsulation of a logical component is more important in some situations, and it can have performance benefits due do reducing over-fetching.
1
2
0
Sep 21 '17
[deleted]
1
u/fred_emmott Sep 21 '17 edited Sep 21 '17
Eventually we're hoping to drop all the PHP stuff we don't like; for now, we're building replacements, and keeping the existing ones until "pure hack" projects are practical. For hack arrays, strings, and math operations, that's in the HSL, and we'll be adding more - and consistency/predictability is one of the primary goals behind that project.
Though yes, it's another standard library :p https://xkcd.com/927/
1
Sep 22 '17
Why not Python, Ruby, Ocaml or Haskell .... Anything else? What does Hack have over them?
3
u/fred_emmott Sep 22 '17
It's very hard to answer this without getting into one of the usual language wars, but I'll try for Python and Ruby:
some parts of PHP are awesome for web development - e.g. the idea that a request is the entire lifecycle of your program. This isn't just about dev workflow - the 'nothing is shared between requests unless you explicitly store it somewhere' thing is great
the hack typechecker
Python and Ruby also both have things they do better than Hack and PHP; which one is 'best' depends heavily on the context.
I've not worked enough with Ocaml or Haskell to try to answer for them.
1
Sep 22 '17
Interestingly I actually have to agree with your reasoning.
You're right today is not a day for a language war. Have you played with haxl?
11
u/marcini82 Sep 21 '17
That is logical. PHP5 is old, Facebook wants to focus on Hack, and there is no good reason to use HHVM as a runtime for PHP7 by anybody else, when native PHP7 is such big performance improvement that it can easily compete with HHVM. I don`t see any lol here.