Forget PHP! Facebook’s HHVM engine switches to Hack instead

Because PHP 7 broke so much compatibility with PHP 5, Facebook’s Hip Hop Virtual Machine team decided to switch to Hack instead

Facebook’s Hip Hop Virtual Machine (HHVM), a speedy engine for PHP, will not target PHP 7, the most-recent major PHP release, but instead will focus on Hack, a PHP spinoff.

The next long-term support release of HHVM, version 3.24, is due in early 2018 and will be the last to commit to PHP 5 support. 

“Trying to support both PHP 7 and Hack would lead to undesirable compromises on both fronts. We plan to decouple ourselves even more from PHP so that we can make Hack great without having to account for all of the oldest, darkest corners of PHP’s design,” the team HHVM team said.

PHP 7, the follow-up release (there was no PHP 6 release) represents a substantive departure from PHP 5, changing multiple behaviors, some of which was not backward-compatible. With PHP 7 charting a course away from PHP 5, the builders of HHVM want to do the same. “Consequently, HHVM will not aim to target PHP 7,” the team said. “The HHVM team believes that we have a clear path toward making Hack a fantastic language for web development, untethered from its PHP origins.”

Facebook has used HHVM for years almost exclusively to run Hack. The language already had addressed many of PHP5’s shortcomings that PHP 7 also fixes, as well as others that it does not, the team said.

By cutting loose from PHP, the HHVM team hopes to provide developers a better, higher-performing experience with HHVM and Hack. It said many features, libraries, and performance opportunities in the pipeline. Design improvements planned for Hack include :

  • completing Hack arrays, with array-like data structures that are easier to type-check
  • eliminating destructors and references
  • using garbage collection to produce measurable performance improvement.

Hack was built on the PHP ecosystem, and Facebook has plans to make HHVM compatible with current versions of major PHP tools such as Composer and PHPUnit.

But the eventual goal is for Hack to have its own ecosystem of core frameworks. Hack tools and libraries in the works include the Hack Standard Library; TypeAssert, for converting untyped data to typed data; and an autoloader for classes, type aliases, and functions.

Join the newsletter!

Error: Please check your email address.

Tags php

More about Facebook

Show Comments

Market Place

[]