Tech IndustrySep 26, 2019
Amazonbroke&dumb

Why does Facebook use Hack?

Why could they not use any mainstream language? Even if you claim that Hack is just PHP, it still begs the question, why PHP?

Add a comment
Microsoft Q→P⇔¬P→¬Q Sep 26, 2019

They use php because they used php. Now they're stuck with it.

Amazon broke&dumb OP Sep 26, 2019

So you're telling me that they basically have almost two decades of tech debt? Also, most companies start out with some technology that they later upgrade. Amazon dot com was mostly Perl at the beginning.

Wayfair uhg56v Sep 26, 2019

There is a whole different world out there Microsoft. Not everyone is stuck with the stack they have.

Google PHmr67 Sep 26, 2019

Any Turing complete language would suffice.

Amazon broke&dumb OP Sep 26, 2019

Yes, but with mainstream languages, you get rich libraries, tons of tools, best practices, idioms and experienced professionals for free.

Amazon CulStryBro Sep 26, 2019

But not all are equally unpleasant to work with. Some work well for small projects. Some for big projects. Some suck all the time. PHP is in the latter category, from my experience, with bad built in libraries, tons of gotchas, poor organization, version fragmentation, weak typing, bad tooling... Honestly, I like Python and JavaScript for many use cases but I struggle to see where PHP adds value. I like gradual-ish typing, like Python 3, and it is cool that was added to Hack, but struggle to see why a PHP-dialect language would be a good thing.

Facebook rwRP17 Sep 26, 2019

Performance is not bad and we already have a complete toolchain for it. No enough motivation to move away

Amazon sPIE23 Sep 26, 2019

Because they were built on basic LAMP stack back in the day

Amazon CulStryBro Sep 26, 2019

Laughable, mang

Amazon sPIE23 Sep 26, 2019

It wasn’t at the time. But it is now

Facebook foggydesi Sep 26, 2019

PHP allows for rapid development ...hack added typechecks and memoization etc ..at this point no off the shelf language will really work for large tech stacks like FB ... It will have to be customized ( scale/ Dev velocity ) ...FB has the resources to invest in hack and optimize it for Dev velocity which is what it values the most The real question is ...have you heard of anyone using mercurial ? ..

Bloomberg TimeToPlay Sep 26, 2019

I remember when I was at Facebook tour my senior year and they mentioned that they are developing a compiler that compiles PHP to C++. That thing still around?

Facebook wwwroot Sep 27, 2019

@bloomberg No, hack has an interpreter with JIT support (HHVM) now. Php to c++ didn’t work out cause the codebase is too yuge and no c++ compiler can handle that.

Bloomberg TimeToPlay Sep 26, 2019

Because they like to pile on the misery.

Facebook wwwroot Sep 27, 2019

Hack isn’t that bad, it’s closer to C# now, and high quality core libs and internal frameworks make it easy to work on.