On Wed, 2016-04-20 at 18:32 +1000, Jesse Schalken wrote:
> 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.

For that there is some research:

        How many bugs does static type checking catch?
        [...]
        answer: 2%.
        [...]
        not only were development times significantly shorter on average
        with dynamically typed languages, so were debug times.
        
        So all those nasty type errors were actually not having any
        negative impact on debug times, in fact the reverse was true.
        
        http://blog.metaobject.com/2014/06/the-safyness-of-static-typing.html

johannes

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to