Live data from Hacker News

Hack: a new programming language for HHVM

code.facebook.com

321–330 of 422 posts

Re: Hack: a new programming language for HHVM

#321

I am baffled as to why you'd build your castle atop a crumbling foundation. I have wondered why FB didn't use a proper language with proper typing to begin with. I mean, I "understand" logistically: they already had a giant codebase in PHP, migrating a codebase is expensive, and it's difficult to hire and train 1000s of hackers in e.g., OCaml. (They do have some OCaml people, but they are outliers. OCaml was my favor…

If I recall correctly PHP is banned at Amazon, even for internal tools, mainly for security reasons. The team that gives security clearance won't even take a cursory look at the service if it depends on PHP in anyway.

Disclaimer: I have no zero experience with PHP.

Re: Hack: a new programming language for HHVM

#322
post #319

They have best functional programming language geeks around and they made this?

I realize it must be shocking to see functional programming language geeks solving real-world problems in a pragmatic way. :-)

Seriously, though, they wanted to move a large PHP codebase over to a better language, at the scale of a multi-billion-dollar tech company, in a reasonable amount of time. They accomplished this. What's the criticism here?

Re: Hack: a new programming language for HHVM

#323
post #11
post #3

I'm the manager of the team that developed Hack, and I'm sitting here with some of the language designers. Happy to answer your questions.

Do you imagine a future where Hack will merge back into PHP (like PHP 7), in the same style that Beryl & Compiz then rejoined? Or does the team intend for the two to always be adjacent-yet-separate?

HHVM developer & PHP runtime developer here. I've got hands in both runtimes and all even I can say is: Maybe.

I think the most likely outcome is that PHP will adopt some of HHVM's additional features, but remain a separate project. IMO that's a great outcome, since we'll both likely drive the other to be better.

Re: Hack: a new programming language for HHVM

#324
post #87

I am baffled as to why you'd build your castle atop a crumbling foundation. I have wondered why FB didn't use a proper language with proper typing to begin with. I mean, I "understand" logistically: they already had a giant codebase in PHP, migrating a codebase is expensive, and it's difficult to hire and train 1000s of hackers in e.g., OCaml. (They do have some OCaml people, but they are outliers. OCaml was my favor…

The HN crowd seems to dislike (or despise perhaps?) PHP, but it's really not that bad. Yes it has a lot of warts, but it has a lot of things that make it nice for web development. a) try your new code by saving in your editor, and hitting reload in your web browser. b) it's very approachable. People who only know HTML and CSS can be expected to do a little bit of PHP work to integrate their changes. If you setup the…

I'm running multithreaded background processes in PHP pretty successfully. I did not see (and still do not see) a reason why I should have chosen another "proper" language for it.

P.S. The vast majority of arguments against PHP here leads me to conclusion that most of (not all) debaters don't understand how PHP works well enough.

Re: Hack: a new programming language for HHVM

#326

My favourite comments are the ones where some random geeks tell the guys who have built a multi-billion dollar business with hundreds of millions of daily active users how they're doing it wrong. Congrats to Facebook on taking PHP forward. It powers a vast amount of the web and it's great to see that it's getting some engineering love!

>> where some random geeks tell the guys who have built a multi-billion dollar business with hundreds of millions of daily active users how they're doing it wrong.

Remind me the words from Steve Jobs:

"By the way, what have you done that’s so great? Do you create anything, or just criticize others work and belittle their motivations?"

Re: Hack: a new programming language for HHVM

#327
post #92

Earlier quoted context omitted.

Could the same techniques you applied to PHP be applied to other dynamic languages like Ruby or Python?

If you're looking for a statically-typed version of Python/Ruby, I'd say nimrod gets fairly close. It's also fantastically fast and compiles to portable ANSI C.

Nimrod is not a statically typed version of Python in the sense Hack is a statically typed version of PHP. Not at all. Hack is gradually typed, Nimrod is not. Big difference.

Re: Hack: a new programming language for HHVM

#328

Earlier quoted context omitted.

> Maintaining your own VM is no big deal. As someone who has worked on a VM, I couldn't disagree more. It can take years to hash out things as simple as ideally performing primitives for a target architecture, and then things change . Add to that the complexity of optimizing compilers, specification of byte code formats and a consistent virtual machine memory model that can be relied upon across architectures, and th…

I am not trying to belittle efforts necessary for the state of the art VM or programming language implementation. I get paid to do these stuffs, and I am on my third VM/PL project now. It is also true these things take time and not very parallelizable, so while man-month may not be that big, you can't make it faster by throwing more people. On the other hand, I maintain it still is no big deal compared to rewriting F…

If they're wasting money on bad management decisions, they're wasting stockholder money.

They're also continuing to propagate an outwardly facing engineering culture that will make it even harder to hire people to help dig them out of the PHP hole -- perpetuating this further.

Your argument is simply another take on survivor bias fallacy.

> I get paid to do these stuffs, and I am on my third VM/PL project now ... Because, in the end, VM is no big deal.

You keep saying that, and yet, there keep being so few high quality VMs.

Re: Hack: a new programming language for HHVM

#329
post #184
post #170

Earlier quoted context omitted.

I'm appalled and little bit insulted that you group PHP in the same group with COBOL, C and C++ in terms of their foundation. COBOL and C were designed by some of the greatest pioneers of the field, and indeed PHP is built on C.

In the sense that any software written in C is built on C.

True, but a lot of PHP's ... design also reflects C, only that they warped it.

Re: Hack: a new programming language for HHVM

#330
post #231
post #110

Earlier quoted context omitted.

It's more accurate to say that the point is to let you use dynamic typing where that makes sense, and static typing in the many cases where it helps. Hence "best of both".

This comment seems to indicate that you can't use dynamic typing: https://news.ycombinator.com/item?id=7437907

My understanding is that you can use dynamic typing, but not dynamic code generation. Not the same thing.
Post reply on HN