FB Hack

Google drg
Mar 5, 2018 5 Comments

Does a partially statically typed language work in practice?

Are FBers happy with Hack? How much PHP is there running around vs Hack code?

I know Instagram is primarily Python - how about other products? Do they have different stacks?


Want to comment? LOG IN or SIGN UP
TOP 5 Comments
  • Facebook fxau82
    As someone who joined 6 months ago, Hack is pretty awesome. I use mostly c++ but do some Hack as well, and it's really nice to use and learn. I didn't know any PHP before fb and I felt comfortable with hack after about a week or so.

    I don't think there's anywhere in fb that uses vanilla php instead of hack, except for some core php stuff in bits of code, which is intentional.

    That being said, I tried to use Hack for a personal non fb project and found it pretty annoying, mostly because a lot of the commonly used php functions are not typed, so you lose all the benefits. It's great with a codebase like fb though.
    Mar 5, 2018 0
  • Facebook / Eng VeTc80
    Python is super common even outside of Instagram.
    Actually almost all of Facebook’s automation and configurations (and even the target files for the build system!) are written in Python.
    In terms of python with type hints: there is an active effort to move to python3 where type hints are supported. Our IDE (Nuclide) partially supports highlighting type errors for the type annotated functions.
    I personally had love hate relationship with python before typing was a thing, but typing changed it and now I like it more.
    Mar 6, 2018 2
    • New pytorch
      That's pretty cool. Share the same feelings about Python although for ML at least is still the best language imo, more hands on approach. Backend is still lame :( but type hint makes it definitely more bearable. Do you guys use for any backend at all or purely automation?
      Mar 6, 2018
    • Facebook / Eng VeTc80
      Some teams choose to use python for their backend services but (outside of instagram) it’s not as common as C++ (which I’d say the most common backend language).
      Mar 7, 2018
  • Facebook Fork44
    I love it, and would consider using it for outside projects if I ever left.
    Mar 6, 2018 0