3 ms·
How could adding ignored type annotations cause problems? Any problems that arise would have to be there without the type annotations...?
by randallsquared 11y ago
How could adding ignored type annotations cause problems? Any problems that arise would have to be there without the type annotations...?
- aphexairlines 11y agoWithout the type annotations, you're expected to handle dynamic type checks yourself. With type annotations, you might think that tooling does it for you, so you might omit the dynamic checks. But the tooling doesn't necessarily check all your callers, and you end up with unexpected input. This is partly what the Typed Racket writers mean when they say that most gradual typing systems like this one are not sound. http://www.cs.cornell.edu/~fabianm/tpls/papers/20151110.shtml http://www.cs.cornell.edu/~fabianm/tpls/papers/20151110.shtm... http://www.ccs.neu.edu/racket/pubs/popl16-tfgnvf.pdf http://www.ccs.neu.edu/racket/pubs/popl16-tfgnvf.pdf
- lmm 11y agoIt can make debugging harder because "impossible" things happen - when a variable is annotated as a string you may not think to consider the possibility that it's actually an integer. But yes, optional typing is mostly just useless rather than actively harmful.