Useful information about Facebook's new programming language Hack

Interested to know about the new programming language designed by Facebook? Want to get details about the features of Hack programming language? Are you worried whether PHP and Hack can continue to run on HHVM? Please read further to check out the advantages of Facebook's new programming language "Hack", which is a new open source version of PHP.

Why did Facebook opt for a new programming language?

Mark Zuckerberg used PHP to design Facebook in the initial years. But, as a PHP-developed website grows, it starts requiring more number of computer servers to execute PHP in comparison to other programming languages. Later, bugs start cropping up frequently and it becomes increasingly difficult to manage all the relevant code. All these issues with Facebook's original programming language i.e. PHP, could be tackled easily with the new language for Facebook called Hack. Facebook designed Hack as a new version of PHP to get speed and to handle complex software development. Bryan O'Sullivan is the Facebook engineer behind Hack who has come out with the related public statement on 20th March 2014. It seems Facebook have been using this new programming language for a year now before officially releasing it's open source version as per the announcement made here: Facebook engineering blog

As per Facebook sources, a significant part of PHP codebase has been migrated to Hack. On Hack Developer Day to be held in the Facebook campus (at Menlo Park), there are plans to introduce this language.

Advantages of Hack programming language
  • This new Facebook language helps to manage code in a better way as compared to PHP.

  • It helps to eliminate bugs and errors to a larger extent in comparison to PHP.

  • As compared to statically type languages, this one has the ability to run / execute without any compiling (due to usage of both static typing and dynamic typing).

  • Using this language, it is possible to get instant feedback after file editing and web page reloading. Thus, the developer is not slowed down and he / she gets speed as well as safety.

  • It helps in building of complex websites as well as software at a fast speed.

Useful details and features of Hack programming language

  • This coding language runs on HHVM (Hip Hop Virtual Machine), which is an open source virtual machine that is designed for executing PHP and Hack programs. Hack can interoperate seamlessly along with PHP on HHVM.

  • This language is known as a "gradually typed language" as it picks up the best things from statically typed languages (that provide safety by identifying errors at the cost of iteration speed) and dynamically typed languages (that provide speed of development at the cost of quick error identification). The type checking algorithm is incremental to the extent that some code inside a single file can be converted to Hack and the remaining code stays dynamically typed.

  • Some of the most important Hack language features include the following:
    1. Type Annotations

    2. Generics

    3. Collections

    4. Nullable Types

    5. Lambdas

    6. Type Aliasing

    7. Async support

    8. Shapes

  • This language provides instant type checking eliminating the drawback of traditional type checker that used to slowdown the PHP development workflow. An important development activity involves developer moving back and forth from source code to web page and iterating the process to fine tune the changes. Earlier, the type checker used to slow down this process as it took some additional time to analyze the source code. However, with Hack, they have designed an instantaneous type checker that acts as a local server to watch the file system. This server is able to store all source code information in it's memory and automatically updates itself whenever any file modification happens on the disk. This enhanced type checking gets executed in less than 200 milliseconds making it easy for developers to integrate into the development workflow without any significant delay.

  • Hack is written primarily in OCaml language that has been developed by the Gallium team (INRIA).

  • The type safety as well as refactoring benefits provided by this language helps it to co-exist with other PHP files. This was done taking into consideration that it will be difficult for some code to be totally migrated to Hack immediately. So, this language has been introduced and adapted incrementally.

For further details about Hack programming language, one can refer the website By participating in Hack communities and HHVM communities, you can share your feedback / opinion about this language. More than 1700 people are already following Hack language Twitter page at Twitter link for Hack.

Read Review of Zend Studio 10: An efficient tool for PHP programming

Related Articles

Future price of Facebook IPO share

Facebook IPO share is in news for last few days. In USA, investors and buyers are willing to know Future price of Facebook IPO share. Facebook Inc expected valuation price will be 100 billion and it is expected to raise to 10 billion after Facebook IPO launch. Facebook IPO price per share will lie in range of $ 38-$ 45. Read this article to know Future price of Facebook IPO share.

Most popular Facebook Apps: Tips to understand and use

The article describes some of the new applications available on Facebook, which are unknown to many. Some of them include EnemyGraph, Gogobot, Artfinder, Causes, Grockit, snooth, Runkeeper and many more which make the existing applications on Facebook more handy and simple in the use.

How to edit comments in Facebook?

Looking for how to edit your comments in Facebook? Read this article to know more about "how to make changes to your previous comments posted by you in Facebook?" This article also helps you on "how to track your edit history?"

More articles: Facebook Social Networking Sites


No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: