I'm having fun writing a simple type checker, but I'm learning firsthand why syntax-directed checking doesn't work. It prevents inference.
My checker catches real bugs, but it can't handle cases like this:
[1, 2].map(fun(x) { x + 1; })
I think I need bidirectional checking.
miniblog.
Related Posts
Noodling with an interpreter for a statically typed language with reified types (e.g. a list knows what type it contains).
Currently I have a single representation of types in both the runtime and the type checker. I think that's a good thing?
I've written a very small, very bad, type checker for my toy programming language. Within three days, it found a bug in a program I was writing!
The tradeoffs of type system design, and thinking about a gradual type checker for Elixir:
