Hacker News new | past | comments | ask | show | jobs | submit login

At runtime, we check and enforce parameter types at function entry and return types at function exit. The extra type information can also enable the JIT to emit more efficient code in some cases, and work is ongoing to make that even more efficient. But having these types is independent of being in Hack -- you can have fully untyped Hack code, though I wouldn't advise it, as you are leaving one of the most powerful features of the language on the table.



What do you do with higher-order functions (which PHP has I believe)?

If I write a typed map : (a -> b) -> [a] -> [b] and then it's called with an untyped function as input, but it returns a something that's not a b. Do you place some kind of barrier around it so that that's stopped immediately?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: