Hack Programming language By Facebook

GeekBoy Short: Hack programming was developed facebook in 2014, many people still don't about this programming language, so here we're telling you about it ;)


Hack programming language was developed by facebook for  HipHop Virtual Machine (HHVM), The language implementation is open-source.

It is designed to interoperate seamlessly with PHP, which is a widely used open-source general-purpose scripting language that was designed for web development and can be embedded into HTML. A majority of valid PHP scripts are also valid in Hack; however, numerous less frequently used PHP features and language constructs are not supported in Hack.

It has deep roots in PHP. In fact, most PHP files are already valid Hack files. Facebook made a conscious choice not to support a handful of deprecated functions and features that were incompatible with static typing (e.g. “variable variables” and the extract() function). Facebook have also added many new features that we believe will help make developers more productive.

Type Annotations:

Type annotations allow for code to be explicitly typed on parameters, class member variables and return values.

Hack Nullable Types:

Nullable Types are supported by Hack through use of the ? operator. This introduces a safer way to deal with nulls and is very useful for primitive types that don’t generally allow null as one of their values, such as bool and int (using ?bool and ?int respectively). The operator can be used on any type or class.

Learn more at http://hacklang.org/, code.facebook.com

Are you going to try Hack programming language ? let us know in the comment! 🙂