Become Our Fan on Social Sites!

Facebook Twitter

Google+ RSS YouTube

Wednesday 2 April 2014

Hack - New Programming Language By Facebook

Facebook just released new programming language named 'Hack'. Hack is a programming language for HHVM (Hip Hop Virtual Machine) that interoperates seamlessly with PHP (Hypertext Preprocessor).
 
Hack New Programming Language
Hack - Programming Language By Facebook




Hack programming language is open source and designed by Julien Verlaguet, Alok Menghrajani, and others. Hack was introduced on March 20, 2014.

Hack is a Cross-platform programming language.

Majority of PHP codes works in Hack programming language. We can say that Hack programming language is a new version of PHP.

Statically typed languages such as Java, where you are required to carefully define your variable types but Hack, allows developers to use both dynamic typing and static typing. In short we can say 'gradual typing'.

Unlike other statically type languages, Hack programming language can run without compiling.

Facebook already uses Hack programming language to run its own website.

There are some following features included in Hack programming language:

1.  New collection types: Vector , set and map

2.  Use generics for collection types.

3.  Class member must be initialized.

4.  Create your own generics.

5.  Specify constraints on generics.

6.  When a type is too long, you can use a type alias.

7.  <<Override>> is used to specify that method has been inherited.

8.  Ability to catch errors early.

9.  Static type checking.

10. Lambda expressions

11. Run-time enforcement of return types and parameter types.

12. Instantaneous type checking.

13. Collections provide a clean, type-safe alternative to PHP arrays.

Following is a syntax for Hack programming language:

<?hh
          echo 'Hello World';

To run above code, you have to install Hack and HHVM. Following is a official Hack programming language website, where you can find supported operating systems:

Official Hack language site: Hack Language

0 comments :

Post a Comment