Hack: a new programming language for HHVM
31–40 of 422 posts
Re: Hack: a new programming language for HHVM
#32I'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.
whats the state of the type system like? Here[1] it suggests that it may have bugs, is this a 'covering backside' thing or is it currently unsound? [1] - http://hacklang.org/manual/en/hack.annotations.summary.php
It's complicated.
If you use partial mode, which doesn't enforce that every function is fully typed, then it's trivial to break the type system by just using an untyped function. In order to ease conversion, we just assume the programmer knows what they are doing with untyped functions and let anything pass.
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.
Some types are enforced at runtime -- just like PHP5 enforces class type annotations on parameters. However, at least for now, the runtime doesn't do a lot of the clever things with the type system that the static typechecker does. It's much more conservative with using the type information, and doesn't do things like check generics at all. (At least right now! We probably will change this in the future.) This means that we can play a little more fast and loose with the type system in the static parts; we want it to be sound, but it doesn't have to be right now; it's not going to cause a JIT crash or anything.
There are more details on the modes here: http://hacklang.org/manual/en/hack.modes.php
Re: Hack: a new programming language for HHVM
#33"Hack provides instantaneous type checking via a local server that watches the filesystem." What does this mean?
On Linux, we use the inotify subsystem to be informed every time you save a source file or switch branches. The hh_server process can then update its data structures immediately, without being explicitly asked.
Re: Hack: a new programming language for HHVM
#34I'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 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?
Re: Hack: a new programming language for HHVM
#35Naming a language hack ... very poor choice. Searching for Go, C, C++ is already bad, now you can add hack to the list.
Re: Hack: a new programming language for HHVM
#36I'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.
Can I embed it? Or extend it via compiled binaries written in C/C++?
Re: Hack: a new programming language for HHVM
#37I'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.
Thanks for taking the questions! How extensively is Facebook using Hack at this point? Is it in production? What has been the biggest learning/unlearning you've needed to do going from PHP to Hack?
The biggest learning step for our engineering teams was to treat type errors from Hack as actual logic errors. We have a collection of "linters" that provide advice on code style and other nice-to-have factors. Some people (quite reasonably) initially thought of Hack errors as lint-like stuff that it was safe to ignore, when in fact they indicate real logical inconsistencies in code.
Re: Hack: a new programming language for HHVM
#38I'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.
Re: Hack: a new programming language for HHVM
#39Re: Hack: a new programming language for HHVM
#40I'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.