r/programming • • Mar 20 '14

Facebook introduces Hack: a new programming language for HHVM

https://code.facebook.com/posts/264544830379293/hack-a-new-programming-language-for-hhvm/
802 Upvotes

526 comments sorted by

View all comments

297

u/[deleted] Mar 20 '14

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.

84

u/detroitmatt Mar 20 '14

If I'm not already using PHP, why should I use Hack?

→ More replies (89)

177

u/expertunderachiever Mar 20 '14

Couldn't you name it php++ like it should have been called? :-)

172

u/alokmenghrajani Mar 20 '14

The PHP license would not allow it: "4. Products derived from this software may not be called "PHP", nor may "PHP" appear in their name[...]"

286

u/expertunderachiever Mar 20 '14

just put the name backwards then.

212

u/MikeTheStone Mar 20 '14

dHd

0

u/[deleted] Mar 20 '14

[deleted]

→ More replies (5)

25

u/Feirlane Mar 20 '14

And then get sued by the Stargate people

32

u/[deleted] Mar 20 '14

GNP:

GNP's Not PHP.

→ More replies (2)

35

u/Vulpyne Mar 20 '14

I wonder if they could have called it QIQ.

→ More replies (14)
→ More replies (18)

57

u/max_t2 Mar 20 '14

yeah "Hack" is a weird name for a programming language...

23

u/Steltek Mar 20 '14

Moreover, "Hack" is a weird name whose principle (only?) improvement is static typing. In my mind, a "hack" language is like Perl. Quick, dirty, and able to twist reality for no reason other than "I want to".

→ More replies (57)
→ More replies (5)

37

u/[deleted] Mar 20 '14

Why aren't you working on haskell? ;)

70

u/[deleted] Mar 20 '14

What makes you think that I don't do that, too? :-)

→ More replies (5)

36

u/jellofiend84 Mar 20 '14

I think more thought should be put into names, especially programming languages that if they become popular will be googled a bunch. Hack maybe a great language but I imagine it would be a pain to work with when you run into an issue and want to google: hack <programming problem> example Even if hack becomes the #1 language I doubt that will return useful information. Google is probably my most important development tool and you've completely neutered it.

20

u/christophermoll Mar 20 '14 edited Mar 21 '14

I usually don't take issue with programming language* names, since it didn't hurt Java, Ruby, Python, or other languages with names that are real words. But I can definitely see "Hack" being a problem, since it's not just already a word, but a word already associated with programming. Even limiting your search to SO or another specific site won't eliminate extraneous results.

14

u/[deleted] Mar 21 '14

Have you ever tried to learn R? Ugh...

→ More replies (1)
→ More replies (1)
→ More replies (1)

22

u/snowe2010 Mar 20 '14

Why did you use the name Hack, which is already a programming language used in Elements of Computing Systems by Nisan and Shocken?

31

u/mk270 Mar 20 '14

Cheers.

The writeup linked above says it's in OCaml ("Hack is written primarily in OCaml. "), but github has it mainly in C++ at https://github.com/facebook/hhvm .

Are there two implementations, or is there some part (e.g., compiler) written in OCaml as part of a larger system?

37

u/shaver Mar 20 '14

While HHVM in the large is mostly C++, the Hack portions themselves are mostly in OCaml: https://github.com/facebook/hhvm/tree/master/hphp/hack/src

→ More replies (1)

18

u/tending Mar 20 '14

Can the JIT use Hack's static typing to generate faster code?

30

u/[deleted] Mar 20 '14 edited Mar 20 '14

It can, and that's something we hope to do quite extensively, but we're just beginning that journey.

→ More replies (3)

20

u/technofiend Mar 20 '14

Could you host a page somewhere besides facebook? This may come as a surprise, but facebook is considered non-essential for work and is blocked at a ton of places.

Still I'd like to read all about it and maybe benefit from your team's work. So maybe a github page or something?

→ More replies (2)
→ More replies (116)