An accessible introduction to type theory and implementing a type-checker
How do you check if an expression is an int or string? How do we formally define a type system? How do we implement it in a compiler? All answered in this tutorial.
mukulrathi.co.uk