3 ms·
I always found Hack interesting. It's PHP slowly transformed step by step into something closer to Java (Java isn't as bad as new grads claim, compared to PHP i
by AnotherGoodName 1y ago
I always found Hack interesting. It's PHP slowly transformed step by step into something closer to Java (Java isn't as bad as new grads claim, compared to PHP it's actually great). It's pretty much exclusively used at Meta.
Basically what they did is they had repeated codemods (changes to the entire codebase with automated tooling) that bit by bit moved PHP closer to Java. More and more static typing, generics, all the common Java ADTs (Vector, Map, Set, Pair, etc.), bytecode+JIT execution, etc.
Essentially instead of rewriting the codebase to a better language they just changed the language itself. Which makes sense since PHP is a much smaller codebase than the Meta backend.
- benburleson 1y agoI dabbled in Hack and HHVM several (almost 10 now??) years ago but haven't kept up. My understanding was that PHP8+ now includes the improvements that Hack brought, making the leap to Hack less interesting/valuable. Is that not the case?
- chuckadams 1y agoPHP caught up with Hack's performance, but it still doesn't have many of its features, notably generics and async/await.