Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

Facebook's Hack programming language builds code safety into PHP

Joab Jackson | March 21, 2014
Hack pairs PHP's ease with the safety controls of older languages

Certain deprecated PHP features, however, are not supported in Hack, and neither are a handful of features that don't work well with static typing.

Hack also comes with a number of additions not found in PHP. One is Collections, a way to create arrays with more nuance than the array function offered by PHP itself, O'Sullivan said.

Hack also eases the use of closures through the use of Lambda expressions. Closures, which were added to Java 8, "make it easy to succinctly write fairly complicated data transformations," O'Sullivan said.

Hack's Lambda expressions provide a way to create closures "with a fewer number of keystrokes, which is a big win for productivity," he said.

Facebook has supplied a number of text editor plug-ins on the Hack website to help coders write in the language, though the company is hoping volunteers will build a few more elaborate ones.

O'Sullivan didn't reveal any specific plans to offer the Hack augmentations back to the keepers of PHP, though he did note that the company plans to "work closely with the open-source community," to further develop the language.

 

 

Previous Page  1  2 

Sign up for CIO Asia eNewsletters.