14 Comments

Summary:

Facebook is trying to make it easier for its developers to write code quickly, so it has built a new programming language called Hack. It’s transitioning as much of its code to Hack as possible going forward.

Facebook is at it again, introducing a new programming language designed to make the process of writing and testing code faster. Called Hack, it has been in use for a year at the social networking company, and on Thursday Facebook released it as open source.

Hack is a programming language that Facebook developed to combine elements of static-type programming languages such as C with dynamic-type languages like PHP. When you code in a static programming language it will let you know when you have an error before the program runs, but in the more modern, dynamic type language you code until the program crashes. Facebook is a PHP house, but Bryan O’Sullivan, manager of the Hack team, said that with many developers working on a variety of projects, the benefits of being able to catch errors before running the program began to make sense. It let developers code faster, which may be just as important as writing code that runs faster when you ship as much code as Facebook.

From the Facebook blog post:

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.

Thus, Hack was born. 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.

So, in typical Facebook fashion a couple of engineers got together to build what O’Sullivan called a gradual-type language that became Hack. 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. O’Sullivan said Hack has no affect on how fast the code runs.

As for who might use this given that Facebook has made it open source, O’Sullivan says, “You might think this is only important to large companies, but the actual fact is small teams and individual developers could use this too so we think this could be beneficial to a large number of people.

  1. a significant contribution to soft world

    Share
  2. I guess anything is better than PHP :)

    Share
  3. Did they deliberately name it so that it was impossible to google anything about it?

    Share
    1. They named it in the hopes that US Courts and police finally stop associating “hacking” with “criminal activity”.

      Share
  4. So it’s C# with uglier syntax and none of the benefits of .NET. Nice.

    Share
  5. So it’s C# with uglier syntax and none of the benefits of .NET. Nice.

    Share
  6. So it’s C# with uglier syntax and none of the benefits of .NET. Nice.

    Share
  7. Crawling back to static types, huh? But static typing is for old people!

    Share
  8. Bubble gum BS high level useless language on top of sticky tape and a deck of cards. Facebook, are you sure you didn’t start working for Microsoft suddenly? I thought they were the only ones who turned out such crap as this. I stand corrected.

    Share
  9. Rob Page : BittySites.com Thursday, March 20, 2014

    Where can i find information to start programming using this new language?

    Share
  10. Tudor Lapusan Friday, March 21, 2014

    I like Facebook’s strategy to open source some of their own code. The first framework open sourced by Facebook that comes into my mind is Cassanda, and they also have a big contribution to Hadoop and Hbase open source frameworks.
    Keep walking in this way ;)

    Share

Comments have been disabled for this post