On Thu, Apr 14, 2016 at 10:47 PM, Lin Yo-An <cornelius.h...@gmail.com>
wrote:

>
> I think the original purpose of adding type system in Hack, is to provide
> just-in-time compilation, this provides more information to let compiler to
> optimize the code with specific type.
>
>
Last I checked, the HHVM JIT treats PHP and Hack code roughly identically
and doesn't use the Hack type annotations for any optimisation. It's is
really just another dynamic language JIT, like V8 and Chakra.

The purpose of type annotations and type checkers for dynamic languages,
including Hack, TypeScript and Flow, is not necessarily to improve
performance but to improve developer efficiency. Wherever there exists a
type annotation which is enforced, either statically or at runtime, the
developer has gained important knowledge to inform the modification of the
program, and can do so with increased certainty and predictability.

Reply via email to