News for hackers. Stuff that matters.
Re:Hack: a new programming language for HHVM by anaphor on Thursday March 20, 2014 @12:48PM (#7436778)
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 things, which it doesn't seem like Hack is. Also I guess the language is supposed to be a superset of "valid" PHP, although I don't know whether this is true without modifying the PHP program much.

http://hacklang.org/manual/en/hack.annotations.types.php

Re:Hack: a new programming language for HHVM by samth on Thursday March 20, 2014 @01:24PM (#7437084)
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.
Re:Hack: a new programming language for HHVM by DeGuerre on Thursday March 20, 2014 @09:41PM (#7440143)
I assume that "local inference" means, in practice, "no let-polymorphism". That's what causes most of the headaches with extensions to Hindley-Milner (including the undecidability of subtyping).
Re:Hack: a new programming language for HHVM by anaphor on Thursday March 20, 2014 @01:31PM (#7437149)
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.