News for hackers. Stuff that matters.
Re:Is sound gradual typing dead? by whoisthemachine on Sunday February 07, 2016 @02:16PM (#11054284)
Typescript (an extension to JS that adds type-safety) essentially does option 3 as well.

As the sibling noted, there are instances during runtime where the type checking fails, especially because Typescript is compiling to Javascript. I have had moments where a numeric observable in KnockoutJS had to be forced to a number when receiving a new value; the form that the observable is bound to is simply returning a string, and while the TS interface for KnockoutJS says the observable is a number, the actual JS doesn't care and just returns what the form gives it.

In some ways this is a failing of Typescript; it shouldn't allow strongly-type interfaces to be wrapped around JS that can return varying types.

Re:Is sound gradual typing dead? by spankalee on Sunday February 07, 2016 @11:39PM (#11056354)
Typescript doesn't insert any runtime type checks at all. It also can't know that interfaces for raw JS are typed wrong, because Typescript is only a static checker.

Dart in checked mode does insert runtime type checks, but leaves them out in production mode.