Live data from Hacker News

Hack: a new programming language for HHVM

code.facebook.com

361–370 of 422 posts

Re: Hack: a new programming language for HHVM

#361
post #85

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…

> I am baffled as to why you'd build your castle atop a crumbling foundation. Because perfect is not the enemy of the good? Because "build atop a crumbling foundation" has demonstrated time and again to be, by far, the most successful way to accomplish anything in computing? Unless you have some example of perfect, now dominant, technologies that have been created ex nihilo that I'm missing? I mean we (facebook) are…

Actually Twitter has been pretty successful in migrating a good chunk of their codebase from Ruby to Scala.

Facebook can keep PHP for the thin web layer that renders the page, but they could have migrate the meat of their code to a safer and more robust language.

Re: Hack: a new programming language for HHVM

#362
I don't understand why there is so much fuss about PHP in 2014. Hasn't most serious web development moved beyond scripting languages? Java and C# have been mature languages for statically-typed web development for years and are not difficult to achieve competence in. And for more fluid yet terse server-side languages you could always go with Ruby, or Smalltalk, or Racket, or F#, and their associated frameworks. Defending PHP in 2014 is almost as surreal as defending Classic ASP in 2014.

Re: Hack: a new programming language for HHVM

#363

Earlier quoted context omitted.

Because "build atop a crumbling foundation" has demonstrated time and again to be, by far, the most successful way to accomplish anything in computing? I can't imagine where that sort of conclusion comes from. Building on a crumbling foundation seems to be just about the most proven, reliable way to ensure your software project won't survive more than a short time without needing serious effort just to maintain it an…

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

Compared to C++

Compared to C++ a language made of explosions and guttural sounds is an elegant way of communication.

Re: Hack: a new programming language for HHVM

#364
post #132

Earlier quoted context omitted.

Which is nonsense, because: 1. I have never seen a framework that didn't go to great lengths to update to new changes quickly in development 2. Which means you lose resources between requests, unless you stuff them into the interpreter/httpd itself. And anyway this is only a problem for PHP , where by default everything runs in the top-level namespace, versus in separate functions. 3. That's a funny way to spin "no c…

blink blink um. have you used java?

Well, even in Play Framework 1.0 in 2009 there was hot reloading. Edit a file, refresh your browser => it's there.

Re: Hack: a new programming language for HHVM

#366

Earlier quoted context omitted.

blink blink um. have you used java?

Well, even in Play Framework 1.0 in 2009 there was hot reloading. Edit a file, refresh your browser => it's there.

On the Atari ST you didn't even have to hit reload, the webpage reloaded automatically as soon as you saved your file. No need to alt-tab even, just keep webpage open next to your editor. Now get off my lawn.

Re: Hack: a new programming language for HHVM

#367
post #215

Earlier quoted context omitted.

> If all of your code is in strict mode, then we believe the type system to be sound. We haven't done any formal proof of this of course, and there have been plenty of bugs in the past. But that's the goal. When I look at this from the docs, it seems unsound: "Hack treats traits as a stand-alone entity during the type checking process. In other words, it ensures type consistency within the trait (i.e., as a black box…

I'm not sure why you think this is un sound. We check traits in isolation -- we ensure that methods you call are either defined in the trait or declared abstract (and so must be defined in the including class). We also added "trait requirements" to the language, so you can say "the including class must implement this interface" ("require implements IFoo") and we'll know that in the type system too. This means that we…

From playing with the editor, it looks like it is sound.

What I thought the quoted passage was saying was that consistency between a class and a trait used by the class was not checked. That's clearly not the case, though. I don't understand what the performance point is, though, since I don't think the copy-and-paste style would produce different answers.

Finally, the online editor doesn't seem to honor // strict -- it doesn't produce an error when some methods aren't annotated.

Re: Hack: a new programming language for HHVM

#368

Earlier quoted context omitted.

How does your approach compare to Typed Racket and Typed Clojure? Could they conceivably achieve the same performance or is there a fundamental difference?

Does Typed Racket have DrRacket support for instant feedback on errors? (It didn't 4+ years ago when I used Racket.) Typed Racket also includes more types, like ": Integer [more precisely: Negative-Fixnum]" (from docs), as well as polymorphic data structures and higher-order functions. I don't know if this is a "fundamental difference" but it might mean Facebook's type checker can optimize in certain ways that Racket…

Yes, Typed Racket does have that -- DrRacket continuously expands in the background, so Typed Racket gets it for free by integrating into the macro system.

The Typed Racket type checker is much slower than Hack, though.

Hack does seem to have polymorphic data structures and higher-order functions.

Re: Hack: a new programming language for HHVM

#369

Earlier quoted context omitted.

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 th…

This isn't true. Every Linux users encounters problems with drivers. By integrating them into the kernel we have an eco system where drivers are out of reach of many users and OEMs. Consider the difficultly in making a desktop scanner for linux. Additionally kernel changes can break a driver with little recourse on the OEMs side, you must simply bend to Linus's will. At the end of the day we suffer from Linux's drive…

So true. Windows' services and drivers system may not be beautiful but it full on works most of the time and it allows even non pro Windows users to change basic stuff with far greater ease than Linux which is a real shame given Linux' potential for transparent usability (a potential it has had since the late 1990s but I have personally given up waiting for it to come true)

Re: Hack: a new programming language for HHVM

#370

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…

I think the short story is that the engineers at Facebook feel pretty productive with their stack today. Making a new language that basically fixes up PHP is ideal for them because it gives them good confidence they can get the benefits of static analysis without sacrificing much productivity. That level of productivity + the sheer numbers they have make Hack a more attractive option.
Post reply on HN