4 ms·
Gradual typing is awesome, though relatively hard to implement. At one point you do have to make a decision though. If you come from a static type system, the
by perlgeek 10y ago
Gradual typing is awesome, though relatively hard to implement.
At one point you do have to make a decision though. If you come from a static type system, the compiler rejects programs if it can't proof their type correctness. Dynamic languages that introduce statics types typically do it the other way 'round: in case of doubt, allow the program at compile time, and possibly throw a type exception at run time.
You can try to make separate decisions in separate scopes, but then you have problems at the boundaries between such regions.
The point I'm trying to make is that gradual typing comes with its own complexity, both on the implementation side and through cognitive load for the programmer.
- stcredzero 10y agoGradual typing is awesome, though relatively hard to implement. It doesn't have to be any harder than a language with a JIT VM. See Strongtalk and Dart. At one point you do have to make a decision though. If you come from a static type system, the compiler rejects programs if it can't proof their type correctness. Dynamic languages that introduce statics types typically do it the other way 'round: in case of doubt, allow the program at compile time, and possibly throw a type exception at run time. Also wrong. See Strongtalk and Dart. If you wanted to, you could make a variant of either system not compile your app without every type specified.
- sharpercoder 10y agoAlso see PHP, C# (dynamic and object), TypeScript.