Get the latest tech news
Subtype Inference by Example
Programming, math, and other things gratuitously nerdy
In this series of blog posts, I will show you how to actually implement algebraic subtyping, or rather, an improved version I call cubic biunification which is faster and easier to understand, with detailed, step-by-step code examples and zero mathematical proofs. In order to keep things simple, the initial feature set of cubiml is deliberately very minimal - it doesn’t even have numbers, strings, or useful compiler error messages. In the next post, we will begin implementing the compiler’s front-end, which is responsible for parsing the input and translating syntax-specific details into calls to the type checker.
Or read this on Hacker News