Live data from Hacker News

HHVM 4.0.0

hhvm.com

11–20 of 21 posts

Re: HHVM 4.0.0

#13
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.

Re: HHVM 4.0.0

#15
post #2

> 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?

Some WordPress hosts were using it

Re: HHVM 4.0.0

#16
post #15
post #2

> 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?

Some WordPress hosts were using it

But with this release it will no longer be compatible.

Re: HHVM 4.0.0

#17

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 ar…

I'm not sure anyone is debating that in the terms of PHP7 vs HHVM. Hack has been a different language for quite some time and that is exactly the problem. The more it diverged from PHP the less sense it made for most people to go that direction.

Also on a personal level I'm really not sure why anyone would want to go that direction. Of all the problems people usually say they have with PHP, just fixing the type system is not even close to #1. If Hack then really is a different language and you don't like PHP, why not migrate to something completely different?

Re: HHVM 4.0.0

#18
post #2

> 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?

At some point we made sure that phpMyFAQ works on HHVM - but afaik we never really got any feedback that anyone's actually using it, but we're not on the same level of users as phpMyAdmin for example :). And with this direction it will not be advertised or checked any more in the future either.

Re: HHVM 4.0.0

#19
post #17

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 ar…

I'm not sure anyone is debating that in the terms of PHP7 vs HHVM. Hack has been a different language for quite some time and that is exactly the problem. The more it diverged from PHP the less sense it made for most people to go that direction. Also on a personal level I'm really not sure why anyone would want to go that direction. Of all the problems people usually say they have with PHP, just fixing the type syste…

Hack layered a sane type system on the existing runtime, but the changes above are all about runtime logic. These type coercions lead to many subtle bugs in PHP programs.

What this demonstrates is that one can have a much safer programming language while keeping the key attributes of PHP that make it great: each web request having isolated state, concurrency model, and programmer workflow (ref. https://slack.engineering/taking-php-seriously-cf7a60065329).

Yes, I'm not necessarily advocating for any web developer to start building in Hack now -- mainly because it lacks PHP's rich ecosystem. The good folks working on the PHP language may be interested in these changes though.

Re: HHVM 4.0.0

#20
post #17

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 ar…

I'm not sure anyone is debating that in the terms of PHP7 vs HHVM. Hack has been a different language for quite some time and that is exactly the problem. The more it diverged from PHP the less sense it made for most people to go that direction. Also on a personal level I'm really not sure why anyone would want to go that direction. Of all the problems people usually say they have with PHP, just fixing the type syste…

> If Hack then really is a different language and you don't like PHP, why not migrate to something completely different?

For server-side web programming, what shall one adopt?

Python and Ruby are great dynamically-typed languages, with rich ecosystems, but don't have any type system. This makes maintenance, and evolution of the codebase, tricky in the long run.

For languages that do have type-systems: Go's is a bit too simplistic, while Java/Scala have robust type systems but are rather slow and don't hit the programmer workflow sweet spot.

There's no silver bullet around.

Post reply on HN