4 ms·
This is very cool and useful. Also it is only necessary because of the lack of type enforcement which means no code can be relied and on and all code has to be
by crystaln 3y ago
This is very cool and useful.
Also it is only necessary because of the lack of type enforcement which means no code can be relied and on and all code has to be constantly inspected for new bugs. Ugh.
- yen223 3y agoI can see this being useful in strongly-typed languages too. There is a massive class of logical bugs that will type-check correctly, that will still result in wrong results being returned.
- jaggederest 3y agoI built a toy raytracer in Haskell for fun. I found all of these bugs. It turns out that when you implement dot product slightly wrong, the image output is very confusing.
- aantix 3y agoTypes do not prove logistical correctness. Imagine a million-line codebase. There are half a dozen suspicious methods with complex sets of if/else if/else statements. And each of those statements make subsequent method calls. Determining that code path is a nightmare. Types won't save you.
- masklinn 3y agoDo you mean logical? Types absolutely do prove logical correctness. In fact that’s all they do. However they can only prove the correctness of logic that’s type encoded. If your program is a primitive soup, there’s not much logic for them to prove.
- 59nadir 3y agoEven just redundant call paths are useful to spot. I recently looked through the standard library of a strongly, statically typed language and found that in one pretty basic function a validation function was called over 8 times despite reliably returning exactly the same result every time and this tool would highlight that very easily. That's not even mentioning the logic bugs you can spot more easily as well.