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

Fitbit to Schumer: We don't sell personal data

14 hours ago

The maker of a popular line of wearable fitness-tracking devices says it has never sold personal data to advertisers, contrary to concerns raised by U.S. Sen. Charles Schumer.

Should you be worried about paid editors on Wikipedia?

18 hours ago

Whether you trust it or ignore it, Wikipedia is one of the most popular websites in the world and accessed by millions of people every day. So would you trust it any more (or even less) if you knew people ...

How much do we really know about privacy on Facebook?

19 hours ago

The recent furore about the Facebook Messenger app has unearthed an interesting question: how far are we willing to allow our privacy to be pushed for our social connections? In the case of the Facebook ...

Philippines makes arrests in online extortion ring

19 hours ago

Philippine police have arrested eight suspected members of an online syndicate accused of blackmailing more than 1,000 Hong Kong and Singapore residents after luring them into exposing themselves in front of webcam, an official ...

Google to help boost Greece's tourism industry

Aug 21, 2014

Internet giant Google will offer management courses to 3,000 tourism businesses on the island of Crete as part of an initiative to promote the sector in Greece, industry union Sete said on Thursday.

Music site SoundCloud to start paying artists

Aug 21, 2014

SoundCloud said Thursday that it will start paying artists and record companies whose music is played on the popular streaming site, a move that will bring it in line with competitors such as YouTube and Spotify.

User comments : 2

Adjust slider to filter visible comments by rank

Display comments: newest first

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