Facebook Rolls Out New PHP-like Programming Language

Mar 24, 2014

New Hack language adds static typing and other conveniences.

Facebook has released an open source version of Hack, a programming language for the HHVM run-time platform. HHVM is a virtual machine for PHP created by Facebook. According to Facebook's Julien Verlaguet, Hack developed as a way for Facebook to address the problem of delivering accurate code in a timely manner at the vast scale of a company like Facebook. “Could early error detection co-exist with rapid iteration, all the while preserving our investment in PHP? Could improved code analysis and introspection help make developers more productive with tools like auto-complete?”
Verlaguet's blog post goes on to explain that "Hack has deep roots in PHP …. In fact, most PHP files are already valid Hack files." The main innovation added with Hack is static typing. Hack’s type system adds features such as generics, nullable types, type aliasing, and contraints on type parameters. Hack also adds Collections (a type-safe alternative to PHP arrays), lambda expressions, and run-time enforcement of return types and parameter types.  
Facebook says it has already migrated nearly all its PHP codebase to Hack.
The Hack source code is available at the project website.

Related content

  • Linux News

    Updates on Technologies, Trends, and Tools

  • NEW ONLINE
  • Facebook Releases Part of its Source Code

    The Facebook social network has released part of its source code under the "Facebook Open Platform" label, including the F8 developer platform which was released one year ago.

  • Welcome

    Newsweek’s story uncovering the man they claim is the creator of BitCoin caused plenty of buzz. As this issue goes to press, the guy they fingered has announced he is filing a lawsuit, claiming that the assertions are false. But according to the story, his brother said “He’ll never admit to starting BitCoin.” So who should we believe?

    Many commentators have argued that the story is not sufficiently corroborated and shouldn’t have been printed, which might be true. But the question of the story’s treatment of facts masks another question that is receiving much less attention: Even if the allegations are true, is this really a news story?

  • PHP Security Principles

    Many web attacks are the result of programmer error. Sloppy code testing leaves a door open for the uninvited.

comments powered by Disqus

Issue 20: GIMP Handbook/Special Editions

Buy this issue as a PDF

Digital Issue: Price $15.99
(incl. VAT)

News

njobs Europe
What:
Where:
Country:
Njobs Netherlands Njobs Deutschland Njobs United Kingdom Njobs Italia Njobs France Njobs Espana Njobs Poland
Njobs Austria Njobs Denmark Njobs Belgium Njobs Czech Republic Njobs Mexico Njobs India Njobs Colombia