Facebook releases Hack programming language for HHVM

Mar 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: CIA director: We didn't hack Senate computers

More information: hacklang.org/

add to favorites email to friend print save as pdf

Related Stories

Dutch ponder giving police the right to hack

May 02, 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

Mar 04, 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 ...

Kosovo group claims hack of US weather service

Oct 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.

Payroll giant ADP investigating hack

Jun 15, 2011

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

Recommended for you

Britain's UKIP issues online rules after gaffes

Dec 21, 2014

UK Independence Party (UKIP), the British anti-European Union party, has ordered a crackdown on the use of social media by supporters and members following a series of controversies.

Sony saga blends foreign intrigue, star wattage

Dec 21, 2014

The hackers who hit Sony Pictures Entertainment days before Thanksgiving crippled the network, stole gigabytes of data and spilled into public view unreleased films and reams of private and sometimes embarrassing ...

User comments : 2

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.