Facebook releases Hack programming language for HHVM

March 23, 2014 by Nancy Owano weblog
Credit: FB

(Phys.org) —Facebook this week unveiled Hack, a programming language they had in use for a year but have now released as per an official announcement posted on the engineering blog on Thursday. What's in it for programmers?

The verdict from numerous tech sites has been that Hack signals much good news. Writing and testing code for Facebook is made faster. The Hack team called it a for HHVM (stands for the HipHop Virtual Machine, an open-source virtual machine designed for executing programs written in Hack and PHP). They already deployed Hack at Facebook. "Over the last year, we have migrated nearly our entire PHP codebase to Hack." Hack has deep roots in PHP, they said. In fact, most PHP files are already valid Hack files. (As GigaOM reported Thursday, Facebook has been running Hack for a year alongside PHP and plans to gradually migrate as much of its new code as possible to Hack.) What's the big deal? To appreciate the big deal about Hack, the team's description of programming difficulties is useful, keeping in mind that slowdowns are no joke when working on Facebook-scale, which involves, said the posting, thousands of engineers shipping new code twice a day.

"Every PHP programmer is familiar with day-to-day tasks that can be tricky or cumbersome," they said. They gave an example of a common mistake where a method could unexpectedly be called on a null object, causing an error that would not be caught until runtime. "Another example," they said, "is a complex API, where developers may have a solid understanding of its semantics but still spend time looking up mundane method names in documentation."

Slowdowns, though, had no easy fix. The question was speed at what cost. Early error detection, it seemed, could not coexist with rapid iteration with dynamically typed language. "Traditionally, dynamically typed languages allow for rapid development but sacrifice the ability to catch errors early and introspect code quickly, particularly on larger codebases. Conversely, statically typed languages provide more of a safety net, but often at the cost of quick iteration. We believed there had to be a sweet spot."

The sweet spot is called Hack. "We believe that it offers the best of both dynamically typed and statically typed languages, and that it will be valuable to projects of all sizes."

They have released an open source version of Hack to the public at hacklang.org/ as part of their HHVM runtime platform, which will now support both Hack and PHP..

Next month, Facebook intends to introduce the language, too, at Hack Developer Day on the Facebook campus in Menlo Park.

Hack is written primarily in OCaml, which is a programming language developed by researchers at INRIA, or French Institute for Research in Computer Science and Automation, billed as being used in environments "where a single mistake can cost millions and speed matters."

Explore further: Payroll giant ADP investigating hack

More information: hacklang.org/

Related Stories

Payroll giant ADP investigating hack

June 15, 2011

US payroll-handling firm Automatic Data Processing (ADP) said Wednesday that hackers broke into one of its benefits administration business systems.

Kosovo group claims hack of US weather service

October 19, 2012

The US National Weather Service computer network was hacked this week, with a group from Kosovo claiming credit and posting sensitive data, security experts said Friday.

Dutch ponder giving police the right to hack

May 2, 2013

The Dutch government has unveiled the draft of a law that would give police investigating online crimes the right to hack into computers in the Netherlands or abroad and install spyware or destroy files.

Security firm finds 300,000 home routers hacked

March 4, 2014

(Phys.org) —Nonprofit American security firm Team Cymru (Celtic world for Wales) has announced that they have uncovered a hacking scheme that has impacted at least 300,000 routers used by people in their homes. Reps for ...

Recommended for you

Interactive tool lifts veil on the cost of nuclear energy

August 24, 2015

Despite the ever-changing landscape of energy economics, subject to the influence of new technologies and geopolitics, a new tool promises to root discussions about the cost of nuclear energy in hard evidence rather than ...

Smart home heating and cooling

August 28, 2015

Smart temperature-control devices—such as thermostats that learn and adjust to pre-programmed temperatures—are poised to increase comfort and save energy in homes.

2 comments

Adjust slider to filter visible comments by rank

Display comments: newest first

Horus
not rated yet Mar 23, 2014
Better solution. If you want ObjC characteristics in PHP then help steer the language. Coming out with a PHP step-child doesn't cut it.

Or just cut the bs and admit you want to use C++, because 90% of that syntax is C++.
alfie_null
not rated yet Mar 24, 2014
Reminds me of Microsoft and the transmogrification of BASIC into VB. Also Google, Go, Dart, and me too.

Looks like a niche language that suggests the focus of its creators. Probably not useful for parallelizing Navier-Stokes simulations, or running faster FFTs, for instance.

Please sign in to add a comment. Registration is free, and takes less than a minute. Read more

Click here to reset your password.
Sign in to get notified via email when new comments are made.