Live data from Hacker News

Hack: a new programming language for HHVM

code.facebook.com

281–290 of 422 posts

Re: Hack: a new programming language for HHVM

#281
I'm really curious to know if any new project will start using this language. I really wouldn't understand why they would. I think that would be an argument to explain why some consider this whole project a loss of time in the long run ( although probably something really great from a purely CS pov)

Edit : i just forgot that i still haven't found any server side language i'm satisfied with. I'm still waiting for a type-annotated variant of python to catch on.... So maybe hack would be a good choice after all. It's such a pity they started this work based on php rather than any other cleaner language.

Re: Hack: a new programming language for HHVM

#282
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.

Why on earth would the solitary example for a shiny new language, use the awful mysql_ library for PHP instead of PDO?

Re: Hack: a new programming language for HHVM

#284

Earlier quoted context omitted.

> What major accomplishments in computing that have been built atop crumbling foundations can claim anything even close to the scale of success of these examples? Wikipedia and Facebook?

Yahoo!, too, is a heavy PHP user.

They're slowly moving to node and java for quite some time. I interviewed there a few months ago and they drilled me on java stuff.

Re: Hack: a new programming language for HHVM

#285
post #227
post #223

Earlier quoted context omitted.

Engineering decisions made in 2003 need not dictate the future of the company more than a decade later. Keep the systems that are written in PHP around for their nature life. Write new systems in whatever is more sensible at the time. Lazy-load your way out of shitsville. Of course this is vastly complicated if they been neglecting modularity and SOA for the past decade and most of facebook is still a monolith.....

Pretty much only the front-end code is written in PHP (or Hack, I guess). Services (things like the feed, the typeahead, graph search, messages, &c.) are written in C++ and other languages - ie, the things it is sensible to write them in...

Well that is good to hear at least.

Do you know if Facebook is still trying to operate out of a single mercurial repository? Or is that only for the front-end code with services having their own repositories?

Re: Hack: a new programming language for HHVM

#287

Earlier quoted context omitted.

PHP is a "crumbling foundation" in exactly the same way DOS, Windows, COBOL, and C and C++ were, are, "crumbling foundations". I don't see how you are disagreeing with me. You are proving the point. You aren't actually going to claim that Windows was well-conceived and theoretically well-founded, are you? Windows has been a never ending refinement on exceptionally shaky ground.

"Windows has been a never ending refinement on exceptionally shaky ground." No. Windows NT was a complete rewrite and it was " well-conceived and theoretically well- founded"

What you say is technically correct, which is the best kind of correct. However, fewer than 1% of Windows programmers ever talk to NTOSKRNL, and probably an order of magnitude fewer do it regularly.

Most of the time, you're talking to Win32/64 or high-level services based on DCOM or .NET, where the "well-conceived" and "theoretically well-founded" stuff doesn't turn up. You can go your whole career without knowing that there's a well-designed kernel under all that cruft.

I'd guess that less than half of Windows developers could say what the object manager does.

Re: Hack: a new programming language for HHVM

#288
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…

Has anyone tried to copy these good parts of PHP, except with a not shitty language?

Is there anything about PHP, the language, that lends itself to this style of development, or could you get these same benefits with, say, Ruby or Python?

Re: Hack: a new programming language for HHVM

#289
post #278

Earlier quoted context omitted.

> Personally, I'd have expected you to make something akin to CoffeeScript or ClojureScript that targets PHP, and can "link with" your existing PHP modules. We took a similar approach to what you described. Then we called it Hack. This is what we mean by seamless inter-operation: the HHVM runtime understands both syntaxes and runs both <?php and <?hh code in the same process. Whether Hack integrates into the runtime…

But the syntax you've got now is effectively a superset of PHP, and comes with all the problems of PHP. You've effectively wrapped your Big Ball of Mud... in slightly different-colored mud. The whole point of a clean-break-targeting-interoperability like this is that you can stop using mud at all , and it'll still work with what you've got now. In fact, what other reason would you have ? If you mean that future versi…

PHP's syntax is not what's preventing you from writing large maintainable systems in it. Many of the more successful languages throughout history became successful BECAUSE they used a syntax that's superficially similar to something familiar.

That's not to say that syntax doesn't matter, but semantics and pragmatics tends to matter more, despite Wadler's Law of Language Design stating that most people don't understand this.

Re: Hack: a new programming language for HHVM

#290

Earlier quoted context omitted.

C, simple and predictable? You've got to be kidding me: http://lwn.net/Articles/586838/

It can definitely be simple, but if you're writing C you're compiling directly on hardware. If you change the hardware, your program will not run. That is literally the definition of unreliable.

That's a stupid definition for unreliable.
Post reply on HN