3 ms·
A type system is a tool. No tool makes anything better without actually using it. Saying that applying a type system to an incorrect program doesn't make it co
by dylukes 12y ago
A type system is a tool. No tool makes anything better without actually using it.
Saying that applying a type system to an incorrect program doesn't make it correct without refactoring is like saying hanging a painting with nails doesn't work without a hammer.
It's true, but misses the point. Programmers tend to introduce implicit type information (anything from dynamic types to how you choose which functions to apply to which values). Bunches of bits have to be classified somehow to be useful.
A static type system lets you specify and define that classification explicitly, rather than implicitly.
So, if your mental model of the correctness of a program includes type information (and I assume it does in some manner or another) a static type system is invaluable for proving (re CHC) one facet of the correctness your program. Moreover, if your model isn't perfect – it rarely is – then a type system can allow you to scrutinize and analyze your model more rigorously.