3 ms·
Hack is a rather absurd local maxima language, but the journey there makes sense. Circa 2005, PHP was a reasonable choice for quickly iterating on a website. Th
by metastasis24 2y ago
Hack is a rather absurd local maxima language, but the journey there makes sense. Circa 2005, PHP was a reasonable choice for quickly iterating on a website. The language was quite amateurish, but it's a web-first language, and its edit-and-refresh development loop was better than most languages.
At some point, two things happened. Any change to code, especially heavily used code, became risky because of limited typechecking, and the scale of the site was large enough that running Zend got expensive. Compiling to C++ with HipHop addressed immediate performance concerns, but it's a fragile solution. At some point, you're faced with either rewriting the codebase in something sensible or migrating in-place with a language fork and a custom VM. Facebook opted to pay the ongoing tax of maintaining its own language and having a team that supports it.
An in-house language gives you freedoms like being able to make language changes driven by business needs like privacy, but the language lacks scrutiny of larger community. Some features are half-baked, and it's missing features most popular languages have.
PHP 7 cherry picked enough Hack and HHVM features that it's better to stick with PHP. There's no broader support for the language, and it's not clear HHVM is still faster.
The next time you're involved in language bikeshedding, remember that Facebook went all-in on PHP, and it was a good-enough choice.