Fackebook needed a huge amount of servers to run their PHP code, so they created HHVM to execute it more efficiently – 8 times faster. Wikipedia recently switched to HHVM and increased performance by about a factor 5.
Hack is a PHP-compatible alternative language (including its deficiencies). It is slightly faster than HHVM. It is gradually typed. Not really statically typed because typing isn’t obligatory, but you can add type specifications when you want. You can also run it in strict mode, which means everything has to be annotated.
Convert php to hack:
Add types to function arguments, returns and class members.
Syntactic sugar: you can add member declarations in the constructor instead of the class.
Syntactic sugar: lambda expression: (arg, arg) ==> expr;
Arrays cannot be typechecked, so use Map or Vector. Shape is a fixed-size array with fixed keys – a bit like a class.
Generics similar to C++: the type annotation can be delayed until class instantiation.