Live data from Hacker News

HipHop VM: now at 98.5% PHP framework parity, 16% faster

hhvm.com

41–50 of 112 posts

Re: HipHop VM: now at 98.5% PHP framework parity, 16% faster

#41
post #11
post #7

With the recent discussion on the origins of PHP function names, and about what, if anything, can be done to fix PHP without ruining it...I'm curious about what happens at Facebook. Besides HipHop, do they maintain a strict PHP style among their developers? Even if HipHop can handle all of PHPs variations, I imagine there's time saved by writing optimally-designed (for the human) code, too?

Yes, they have a static analyser for PHP, Hack, written in OCaml http://www.youtube.com/watch?v=gKWNjFagR9k

Internally at my company, we've found https://github.com/scrutinizer-ci/php-analyzer to be very effective (after we made some hacks to support 5.5) and we can put it in our sniff pipeline in CI (a tad too slow for a pre-commit hook).

Re: HipHop VM: now at 98.5% PHP framework parity, 16% faster

#42

I wonder how hard it would be (for me) to take php and change all function names to be consistent. All PascalCase and spelled out (no awful abbreviations). Then download the documentation and change it there as well.

You can write wrapper functions in a PHP script and include it your index.php.

e.g.

  function findFirst ($haystack, $needle, $before_needle=false, case_sensitive=false) {
    if (case_sensitive) {
      return stristr($haystack, $needle, $before_needle);
    }
    return strstr($haystack, $needle, $before_needle); 
  }
You can submit them as RFC to https://wiki.php.net/rfc and maybe your suggestion end up in a future version of PHP. As PHP code in HHVM is almost as fast as C++ code, your wrapper functions will be still useful for you in the meantime.

Re: HipHop VM: now at 98.5% PHP framework parity, 16% faster

#44
post #7

With the recent discussion on the origins of PHP function names, and about what, if anything, can be done to fix PHP without ruining it...I'm curious about what happens at Facebook. Besides HipHop, do they maintain a strict PHP style among their developers? Even if HipHop can handle all of PHPs variations, I imagine there's time saved by writing optimally-designed (for the human) code, too?

For core language features like that, there really is no way to "fix" it. Just pick a better language.

Do you have any PHP code you've written that you can link to? I'm curious as to how versed in PHP you actually are.

Re: HipHop VM: now at 98.5% PHP framework parity, 16% faster

#46
post #31

I wonder how hard it would be (for me) to take php and change all function names to be consistent. All PascalCase and spelled out (no awful abbreviations). Then download the documentation and change it there as well.

Ahh yes, take the most criticized aspect of Java -- the obscene verbosity -- and cram it into PHP. Sounds wonderful.

The verbosity of Java has nothing to do with long function names.

Re: HipHop VM: now at 98.5% PHP framework parity, 16% faster

#47

Hmmm Laravel at 100%. This is now getting interesting!

Drupal is also 100%, that's actually really nice. Want a quick performance boost on your Drupal site, replace PHP with HHVM

This is core though, from what I hear contrib still breaks (haven't tried myself)

Re: HipHop VM: now at 98.5% PHP framework parity, 16% faster

#50

I wonder how hard it would be (for me) to take php and change all function names to be consistent. All PascalCase and spelled out (no awful abbreviations). Then download the documentation and change it there as well.

On paper the lack of consistency is a problem. In reality your editor will autocomplete the function name and tell you its arguments, so it's really not that big of a deal. I mostly hear non-PHP programmers complain about it.
Post reply on HN