Paul Krill
Editor at Large

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

news
Sep 20, 20172 mins

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

porting converting merge switch train track
Credit: Thinkstock

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.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author