A few days ago, Facebook has announced the release of Hack, a PHP based programming language as an open source project. Let’s take a look into the new kid in the block.
What will be hack’s market share?
PHP is used in leading content management systems like Drupal and WordPress, Facebook’s website is PHP based along with 240 million other websites (about 39% out of all) . It takes 3.3% of the programming language market, and much more relevant, 80% of server side programming language, giving Hack a large market \ user base potential.
Hack is a PHP based programming language running on the Hip Hop Virtual Machine, released in 2010 HVVM is a C & C++ based VM that compiles PHP into intermediate byte code code. “This byte code is then translated into x64 machine code dynamically at run time by a just-in-time (JIT) compiler. “
The main and most important feature is static typing: loosely method signatures and variables types are error prawns stuff in dynamic languages such as PHP, so finding the way to enjoy this statically typed languages feature into Hack looke a great idea.
PHP vs Hack
A list of other features: generics, nullable types, type aliasing, constraints on type parameters, lambda expressions, collections, etc. More about the features and how the “type checker” algorithm to implement the static typing here.
One more feature which I found interesting is the “Hackificator”, a conversion tool for an existing PHP project into Hack. Facebook has converted their entire system into Hack using the homemade tool.
Windows Is Not Supported
I wanted to check out Hack in my Windows 8 based home machine, but was surprised to see it is not supported:
Hack has a huge advantage with the the multi-billion company pushing it forward, and it should be interesting to see where will they lead it to. Although in my opinion Hack is not a ‘game changer’, it has enough treats to justify a further look. As a Microsoft user, I am uncomfortable with the lack of support for Windows OS at this point and hope the people in Facebook will come to their senses quickly.