Get the latest tech news
Designing type inference for high quality type errors
Type inference has a reputation for causing unhelpful error messages from the compiler when there is a type error. For example, here’s a typical comment:
Type inference’s bad reputation is due to design decisions in existing languages that sacrifice good error messages in exchange for other goals. (Or possibly, the user was just not aware that Ocaml forbids having both ints and strings in the same list and will be left confused either way as long as the error message doesn’t explain this restriction.) With PolySubML by contrast, the compiler explicitly highlights a location where adding a type annotation is guaranteed to help narrow down the cause of the mistake, leading to much faster and more effective debugging.
Or read this on Hacker News