Goodbye Mysterious Type Errors: How PolySubML Improves Type Inference Error Messages
2025-05-23
PolySubML is a programming language combining global type inference with subtyping and advanced polymorphism. This post explores how PolySubML designs good type error messages and explains why existing languages often fall short in improving type inference error messages. The author proposes five rules: 1. Never guess or backtrack; 2. Don't jump to conclusions; 3. Ask the user to clarify intent; 4. Allow the user to write explicit type annotations; 5. Don't include static type inference in your runtime execution model. By following these rules, PolySubML successfully addresses many common issues with type inference, significantly improving code debuggability.
Development
type inference