Are there any large Hack codebases I can explore? I am interested to see how different from straight PHP it is. Does anyone know if FB tracks changes to PHP so Hack is "up to date"?
Ask HN: State of PHP at Facebook?
31–40 of 88 posts
Re: Ask HN: State of PHP at Facebook?
#32Migrating 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…
Do you know if Facebook uses Composer to manage PHP dependencies?
Facebook's fbshipit: https://github.com/facebook/fbshipit
Google's copybara: https://github.com/google/copybara
With these tools, you can make fairly sophisticated choices about how you do vendoring. You can make the internal version look just like the public version, in terms of commit history. And you can export internal commits to public commits, stripping out confidential information along the way (or integrations with internal systems and tooling).
Re: Ask HN: State of PHP at Facebook?
#33Ex-Facebooker here. Hack isn't going away. Ever. It's actually quite pleasant to develop in. The tooling now revolves around VS Code, which I personally don't like. I wish they'd based this on a Jetbrains core. One thing I learned to love with the Hack type system is that nullability is a distinct type (eg you can assign a T to a ?T but not a ?T to a T; ? here means "nullable"). The static type checking is smart enou…
Wow, that's almost the same thing that Typescript is to Javascript. Is all of that openly available to outsiders? If it is, I think I might to rethink my stance of php that I had for the last 15 years.
I mean, React was developed at Facebook...
Re: Ask HN: State of PHP at Facebook?
#34Has anyone used both Hack and the modern React workflow of Typescript and a mixture of client and server-side rendering? Interested to know how they compare
I haven't seen a huge emphasis on SSI + client other than projects like Next (which is ok but kind of clunky). My experience with Hack was that it was just server-side ... is there some front-end aspect to Hack?
That said, I'm not sure how you'd go about server-side rendering React from Hacklang, as it seems that the open-source solution to do so is no longer supported (https://github.com/hhvm/xhp-js).
Re: Ask HN: State of PHP at Facebook?
#35Earlier quoted context omitted.
Do you know if Facebook uses Composer to manage PHP dependencies?
Facebook uses a monorepo, similar to the way Google does it. Dependencies are vendored and checked into the repo. Facebook has released a tool for migrating software between repos, which is much like Google's Copybara: Facebook's fbshipit: https://github.com/facebook/fbshipit Google's copybara: https://github.com/google/copybara With these tools, you can make fairly sophisticated choices about how you do vendoring. Y…
What does "Dependencies are vendored and checked into the repo" mean?
Re: Ask HN: State of PHP at Facebook?
#36Ex-Facebooker here. Hack isn't going away. Ever. It's actually quite pleasant to develop in. The tooling now revolves around VS Code, which I personally don't like. I wish they'd based this on a Jetbrains core. One thing I learned to love with the Hack type system is that nullability is a distinct type (eg you can assign a T to a ?T but not a ?T to a T; ? here means "nullable"). The static type checking is smart enou…
Wow, that's almost the same thing that Typescript is to Javascript. Is all of that openly available to outsiders? If it is, I think I might to rethink my stance of php that I had for the last 15 years.
Re: Ask HN: State of PHP at Facebook?
#37Are there any large Hack codebases I can explore? I am interested to see how different from straight PHP it is. Does anyone know if FB tracks changes to PHP so Hack is "up to date"?
Specifically they used [2] 'partial mode' since "this loosens several restrictions to ease migration"
[1] https://slack.engineering/hacklang-at-slack-a-better-php/
[2] https://docs.hhvm.com/hack/source-code-fundamentals/program-...
EDIT: This would indicate that Hack may perhaps support standard PHP syntax but not the other way around.
EDIT: According to this [3] they are very compatible.
[3] https://www.oreilly.com/library/view/hack-and-hhvm/978149192...
Re: Ask HN: State of PHP at Facebook?
#38Migrating 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…
Do you know if Facebook uses Composer to manage PHP dependencies?
Re: Ask HN: State of PHP at Facebook?
#39Ex-Facebooker here. Hack isn't going away. Ever. It's actually quite pleasant to develop in. The tooling now revolves around VS Code, which I personally don't like. I wish they'd based this on a Jetbrains core. One thing I learned to love with the Hack type system is that nullability is a distinct type (eg you can assign a T to a ?T but not a ?T to a T; ? here means "nullable"). The static type checking is smart enou…
Wow, that's almost the same thing that Typescript is to Javascript. Is all of that openly available to outsiders? If it is, I think I might to rethink my stance of php that I had for the last 15 years.
I've been tempted to use it for things like static website generation, since it has the "XHP" stuff, which is like JavaScript's JSX... and I'd undoubtedly prefer writing code in Hack to writing code in JavaScript.
https://docs.hhvm.com/hack/XHP/introduction
JSX is based on XHP, of course, not the other way around.