Theme Layout

Boxed or Wide or Framed

Theme Translation

Display Featured Slider

Featured Slider Styles

Boxedwidth

Display Trending Posts

Display Instagram Footer

yes

Dark or Light Style

Facebook's Hack Programming Language Has Deep Roots In PHP; Features Static Typing


Facebook engineers have launched a new programming language called 'Hack' that uses PHP's fast development cycle and brings in a host of new features including static typing. The open source Hack Language has been deployed at Facebook for some time now and the developers at Facebook have been successful in migrating their entire PHP codebase to Hack using the company's very own refactoring tools and organic adoption techniques. The need for a new language was felt because the traditional dynamically typed languages lack the ability to identify errors early and introspect code quickly on large database systems. Whereas, the statically typed languages didn't offer fast iteration, but were quite safe. The company came up with 'Hack' to overcome these shortcomings by finding a solution that offered the best of both worlds.

With the static typing feature, Hack language annotates function signatures and class members with type information. In computer science terms, Hack is a “gradually typed” language, because with it dynamically typed code interoperates seamlessly with statically typed code. Among other features - there's generics, nullable types, type aliasing, constraints on type parameters.


Type Annotations allow for PHP code to be explicitly typed on parameters, class member variables and return values. Collections enhance the experience of working with PHP arrays, by providing first class, built-in parameterized types such as Vector, Map, Set and Pair. Lambdas are just like the PHP closures, but they can capture variables from the enclosing function body implicitly and are low on verbose. While, Generics allow classes and methods to be parameterized. Run-time enforcement of return types and parameter types helps programmers detect and diagnose certain kinds of problems more easily.

Next month, Facebook is also introducing the 'Hack' language at the Hack Developer Day on the Facebook campus in Menlo Park. How do you like the
QuickEdit

You Might Also Like

No comments

Post a Comment

Follow @MyInstantSearch