4 ms·
> "your code compiles" is much closer to "your code is correct". That is so far from the truth.
by mekster 5y ago
> "your code compiles" is much closer to "your code is correct".
That is so far from the truth.
- ben-schaaf 5y agoHow is it anything but the truth? The express purpose of static analysis, like a type system, is to catch bugs before running your code. That pretty clearly means that code that successfully compiles is closer to being correct than code that doesn't.
- mekster 5y agoI mean, correct as in logically correct and that's just a different matter than being grammatically correct.
- morelisp 5y agoThe parser assures your code is grammatically correct; the type system assures your code is semantically consistent, which is usually a much stronger guarantee, and by most practical measures will be closer - often much closer, and for total functions on total types, sometimes all the way - to "logically correct".