Live data from Hacker News

Ask HN: State of PHP at Facebook?

news.ycombinator.com

61–70 of 88 posts

Re: Ask HN: State of PHP at Facebook?

#61

The answer to your first question is yes. Your second question is based on an incorrect premise. Hack is internally built, but it is also open source: https://github.com/facebook/hhvm I joined Facebook in 2019 and left this year. Prior to FB, I worked mostly with python, javascript, and C++. Even at FB, I worked mainly in python (instagram backend), but spent a lot of time in the Hack codebase. My experience was that…

> the tooling will automatically create a diff (PR) to remove the feature flag

That's pretty cool. It just occurred to me that something like this would be almost trivial in a Lisp.

Re: Ask HN: State of PHP at Facebook?

#62

The answer to your first question is yes. Your second question is based on an incorrect premise. Hack is internally built, but it is also open source: https://github.com/facebook/hhvm I joined Facebook in 2019 and left this year. Prior to FB, I worked mostly with python, javascript, and C++. Even at FB, I worked mainly in python (instagram backend), but spent a lot of time in the Hack codebase. My experience was that…

What issues does Typescript have? not saying it has none, just curious. While much faster than python wouldn't nodejs be a bad option for FB/Instagram too? Why not Go?

IMO Typescript will grow on the backend. It's mainly just not as mature as alternatives and will get better over time. There are small problems similar to python though, like module-level mutable global state. That interferes with certain tools and fast restarts, but can be mitigated the same way as is done in python, ie https://instagram-engineering.com/python-at-scale-strict-mod...

Go is not dynamic enough to build useful abstractions. It does not allow developers to make themselves more productive. It's also more difficult to build hot reloading and high quality reflection based debugging.

Re: Ask HN: State of PHP at Facebook?

#63

Earlier quoted context omitted.

This is the second such PHP thread I've seen in the last 24 hours (the other one was on a different web property); gotta love people shitting on PHP like it's 1998

I assume this thread was inspired by the other one. I too am actually interested in the current state of PHP jobs. I previously assumed it mostly entailed working on legacy projects, which is what I do occasionally. I have a younger friend who is primarily interested in working with PHP. I wanted to advise against pursuing it too much due to questionable future prospects, but he’s found gainful employment in a couple…

Personally, I still default toward PHP as a backend for most web apps. While it's not a joy like writing for Nodejs, you don't have to worry about routing or something unforeseen blocking the main thread. I also have to manage servers 24/7 for the apps and sites I build. I simply don't trust Node as much in production.

Re: Ask HN: State of PHP at Facebook?

#64

Earlier quoted context omitted.

This is the second such PHP thread I've seen in the last 24 hours (the other one was on a different web property); gotta love people shitting on PHP like it's 1998

> This is the second such PHP thread I've seen in the last 24 hours (the other one was on a different web property); gotta love people shitting on PHP like it's 1998 I don't care for language wars (or the kind of petty language elitism that people get into with PHP), but: isn't Hack effectively its own language (and ecosystem) at this point? I don't think that Facebook sinking tens of millions of dollars into a custo…

I thought the original reason for it was that Zuckerberg didn't want to have the site rewritten by engineers in a language he didn't know. i.e. find a way to scale up this dorm room code without rewriting it.

Re: Ask HN: State of PHP at Facebook?

#65

Earlier quoted context omitted.

> This is the second such PHP thread I've seen in the last 24 hours (the other one was on a different web property); gotta love people shitting on PHP like it's 1998 I don't care for language wars (or the kind of petty language elitism that people get into with PHP), but: isn't Hack effectively its own language (and ecosystem) at this point? I don't think that Facebook sinking tens of millions of dollars into a custo…

I thought the original reason for it was that Zuckerberg didn't want to have the site rewritten by engineers in a language he didn't know. i.e. find a way to scale up this dorm room code without rewriting it.

Yeah, that's what I meant by the "initial technical decision." Perhaps "technical and ego driven" would have been more precise :-)

Re: Ask HN: State of PHP at Facebook?

#66
post #20

Migrating to Hack from PHP was huge undertaking requiring years to conclude, and that almost kept the same syntax and semantics where possible. What would the benefit of spending thousands of engineer years (read: billions of dollars) on a rewrite be? Especially when it would nearly certainly come with a huge performance regression compared to continuing to use HHVM which has come with years of optimization for worki…

> There really isn't much to gain.

We (external parties) really can't say. We don't know what's holding Facebook's system back, we don't know the challenges it faces both internally and externally. We don't know what VM limits the code is hitting, how well the GC/memory allocation story is for HHVM with Facebook's code (other than what we're told). We don't know how well Facebook's database is or isn't keeping up with the backend, and what future plans the database team has that would change the query profile which could then cause the backend fleet to hit limits of HHVM's tunables with current growth. We also don't know HHVMs team is planning.

If there is a problem that Hack and HHVM hasn't been able to solve, one would hope that the spending of billions of dollars is properly considered. Or to borrow from another expression, I'd hate to be billion-dollar-wise and future-of-the-company foolish. I don't begrudge the exec team for having to make that call and other calls like it. (Choosing to do Hack & HHVM in the first place was a similar judgement call.)

Re: Ask HN: State of PHP at Facebook?

#67

Earlier quoted context omitted.

I assume this thread was inspired by the other one. I too am actually interested in the current state of PHP jobs. I previously assumed it mostly entailed working on legacy projects, which is what I do occasionally. I have a younger friend who is primarily interested in working with PHP. I wanted to advise against pursuing it too much due to questionable future prospects, but he’s found gainful employment in a couple…

Personally, I still default toward PHP as a backend for most web apps. While it's not a joy like writing for Nodejs, you don't have to worry about routing or something unforeseen blocking the main thread. I also have to manage servers 24/7 for the apps and sites I build. I simply don't trust Node as much in production.

Can you elaborate on this? Not the first time I've heard a similar sentiment (and the proliferation of PHP over the years def provides some justification) but I've never heard people explain why.

Re: Ask HN: State of PHP at Facebook?

#68

Earlier quoted context omitted.

This is the second such PHP thread I've seen in the last 24 hours (the other one was on a different web property); gotta love people shitting on PHP like it's 1998

Some people like pretending that other languages don't have their own warts. There are thousands of mature SAAS products that use PHP and don't rely on Wordpress for anything. I don't think that anyone who uses Javascript as part of their backend stack has any room to criticize.

Walmart.com (during Black Friday) would beg to differ. LinkedIn might want a word too. I'm sure every language has its success story(ies) along with a long list of failures. Shopify and Stripe are successful with Rails! JavaScript is no different here.

Re: Ask HN: State of PHP at Facebook?

#69
post #20

Migrating to Hack from PHP was huge undertaking requiring years to conclude, and that almost kept the same syntax and semantics where possible. What would the benefit of spending thousands of engineer years (read: billions of dollars) on a rewrite be? Especially when it would nearly certainly come with a huge performance regression compared to continuing to use HHVM which has come with years of optimization for worki…

> There really isn't much to gain. We (external parties) really can't say. We don't know what's holding Facebook's system back, we don't know the challenges it faces both internally and externally. We don't know what VM limits the code is hitting, how well the GC/memory allocation story is for HHVM with Facebook's code (other than what we're told). We don't know how well Facebook's database is or isn't keeping up wit…

Although currently an external party, I did work on these things at Facebook in the past. And you're right, that any system does have scale limits on a given type of hardware.

Regarding memory allocation: HHVM has per-request memory arenas which get thrown away after each request. That combined with memory and time limits serves to compartmentalize the amount of memory pressure requests can place on the web server. Tuning of concurrent requests and workload mixes allows for some amount of exchanging memory pressure for throughput.

I'm not sure what the comments about the database are: queries to databases and other backend systems are fairly indepent of the language the web server is written in (Instagram is written in Python, and hits many similar or the same systems and those systems don't really care which one is making the request).

For specific components where HHVM is not able to handle them, those pieces can be extracted to separate services written in a different language (C++ or Rust, I think would be the go-tos probably?), with a cost of being unable to depend on libraries written in Hack.

Re: Ask HN: State of PHP at Facebook?

#70
post #54

Hack is open source. My understanding from a talk back in 2014, is hack was developed because of frustrations with PHP evolution. Honestly I think it may have lit a fire under the PHP developers because php7 had significant speed improvements[4]. Talk: "Facebook recently introduced and open-sourced Hack ( https://code.facebook.com/posts/264544830379293/hack-a-new-p... ), a gradually-typed programming language for HHV…

I used HHVM for a while and it was good before PHP7, but then it quickly became irrelevant once the PHP core and community got their act together.

PHP still doesn’t have XHP though :(
Post reply on HN