Live data from Hacker News

Hack: a new programming language for HHVM

code.facebook.com

111–120 of 422 posts

Re: Hack: a new programming language for HHVM

#111
post #90

This rubs me the wrong way. > Thus, Hack was born. We believe that it offers the best of both dynamically typed and statically typed languages, and that it will be valuable to projects of all sizes. In which way does it offer the benefits of dynamic typing? The entire point seems to be to abandon dynamic typing, which is fine, but not what that sentence says. I'm guessing, for example, you can't really do meta-progra…

AFAIK large PHP libraries(Doctrine/Symfony) generate PHP code (from config files for instance) that is then required and executed.

You cant be more meta than that.

I dont know if you can do that with Hack, but that's definetly a big PHP pattern.

Re: Hack: a new programming language for HHVM

#112
post #80
post #13

Earlier quoted context omitted.

Stay tuned. You'll hear more in due course. In the mean time, the open source release of Hack includes integration with both Emacs and Vim.

Facebook IDE incoming?

I think they mentioned something in the browser using js_of_ocaml at CUFP last year.

Re: Hack: a new programming language for HHVM

#113
post #28
post #4

Facebook is always pushing PHP to new places. Would it be too broad to say PHP is the worst thing that ever happened to Facebook's engineering but Facebook's engineering is the best thing that ever happened to PHP?

About the 'new places' - I wonder why they're first abandoning PHP the project and now also PHP the language. I don't see HHVM that much as a 'different runtime' like Rubinius/JRuby/Topaz or Jython/Unladen Swallow/Pypy - it's more a fork in my book, and Hack adds a lot to that by also greatly changing the language. This is not a criticism or even positive/negative - this is my point of view.

However you see it, the HHVM team sees it as a runtime. They make mention of this even in this post. They want to fully support PHP. They aren't abandoning anything. You don't try to build on top of what you've abandoned.

Re: Hack: a new programming language for HHVM

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

Facebook is a relatively mature company now that is in the business of making money. In fact, I would argue that [framework of the week] is more buggy and broken because it less well understood.

Re: Hack: a new programming language for HHVM

#115

Looks like Facebook might have inadvertently turned PHP trendy again. Expect "Why I migrated from Go to Hack" articles soon enough. Either way, the name is very fitting. I have no use for this, but good for Facebook that they've managed to (at least to some extent) evade some of the many PHP pitfalls.

I started web programming using PHP back in 2000, but quickly moved to Python a couple of years later and never looked back. That is, until I joined FB this year as a data engineer. Programming in PHP with Hack/XHP is awesome.

Re: Hack: a new programming language for HHVM

#116
post #102
post #59

Earlier quoted context omitted.

As far as I can tell they are using local inference, which is basically just unification. The set of possible types seems pretty narrow[1] as well so I don't see much room to go wrong. You're right that there is a lot of mathematical theory about type systems and that inference can easily go wrong (be undecidable) but that is mostly for type systems that try to do inference for higher rank polymorphism and other thin…

Local inference isn't just unification. In particular, most local inference algorithms are designed to work with subtyping, which doesn't work in ML-like type systems.

True, I didn't see any mention of subtyping on there but since it's PHP I guess they have to deal with it somehow.

Re: Hack: a new programming language for HHVM

#117
post #34

Earlier quoted context omitted.

My impression is that Facebook mostly write their stand-alone services in Java or C++, and are using PHP only where they're "stuck" with it due to a large existing code base. Do you think Hack is a good language to start a new project in, compared to non-PHP languages? Are you using Hack for things besides the main web page?

Engineer working on Hack here. Yeah, I think Hack is a good language to start a new project in. For as much flak as PHP gets, there are actually a lot of good things about the language. The fast development cycle -- edit php script, refresh -- is something amazing that you don't get in a lot of statically typed languages, which usually have a compilation step. The crazy dynamic things you can do also occasionally hav…

>The fast development cycle -- edit php script, refresh -- is something amazing that you don't get in a lot of statically typed languages

You seriously think that? That's how we do haskell web development. Both yesod and snap do this out of the box. That's how every java developer I know works.

Re: Hack: a new programming language for HHVM

#120

Earlier quoted context omitted.

Why use public string $x = ''; instead of public $x:string = ''; It seems inconsistent to me, probably because I've used AS3/Haxe.

PHP is based on C. It's way more consistent with C, Java, C# , etc to do the former. So the real question is why function foobar() : int { .. } instead of function int foobar() { .. }

Yeah, you could go either way on it really. It seems weird to mix them, though!
Post reply on HN