from Hacker News

HHVM 4.0.0

by marksamman on 2/11/19, 10:58 PM with 19 comments

  • by pushtheenvelope on 2/12/19, 12:58 AM

    A lot of the narrative on HN seems to be that PHP7 has adopted most of the benefits of HHVM (performance) and Hack (typehints).

    If you read this blog post closely, you will notice several interesting points in the Future Changes, which hint at making Hack a significantly saner language than PHP, especially around type-soundness.

    > Several behaviors will be removed from PHP arrays; the general principle is that PHP arrays should work as “vec or dict”.

    > Int-like string keys will not be converted to integers.

    > Binding references to array elements will not be permitted.

    > The values null, false, or uninitialized variables will not be able to be treated as arrays.

    > Empty strings will not be able to be treated as arrays.

    > Arrays will not be able to be compared to non-arrays.

    > Non-arraykey values will not be able to be used as array keys and will not be automatically coerced.

    > Arrays will not be able to be used with the plus (+) operator.

    This is a massive change that goes a long way towards making the most prominent, core data structure of any php codebase be sound.

    Other examples of introducing type soundness:

    > Undefined constants will no longer be converted to strings

    > ints will wrap in future releases, instead of being converted to floats, allowing the type of int + int to be int, instead of int + int = num.

  • by jacobwg on 2/12/19, 1:31 AM

    > We are currently working to move to a package manager that fully supports multiple languages.

    I wonder if this is related to the plans to add a pluggable architecture to Yarn 2.0 and support languages other than JavaScript.

    https://github.com/yarnpkg/yarn/issues/6953

  • by johnmaguire2013 on 2/12/19, 12:01 AM

    > With this release, we no longer aim to be compatible with PHP.

    Looks like a big release! I'm curious -- is anyone actually using HHVM, either in production or for personal use?