4 ms·
The systems with performance issues are the sound ones! Hack does not have a type soundness guarantee. The compiler statically checks your type annotations, bu
by ben_greenman 11y ago
The systems with performance issues are the sound ones!
Hack does not have a type soundness guarantee. The compiler statically checks your type annotations, but then generates untyped PHP code. If Hack-generated PHP interacts with PHP from 5 years ago, "type errors" are possible.
(I have to say "type errors" in quotes because a mismatch between originally-typed and originally-untyped PHP could result in any kind of error message, or no error at all!)
Systems like Typed Racket do type checking at runtime when interacting with untyped Racket code. These runtime checks are the performance problem, but they do accurately diagnose type errors.
- TazeTSchnitzel 11y ago> The compiler statically checks your type annotations, but then generates untyped PHP code. If Hack-generated PHP interacts with PHP from 5 years ago, "type errors" are possible. That's not entirely true. Though some parts of Hack's annotations are not enforced by the runtime, if you say a function takes an int and pass it a float at runtime, it does throw an error from what I remember. It's correct that Hack doesn't guarantee runtime soundness, though.