Coding 2026-02-16
I'm getting started on the elaboration logic. One thing that I'm not sure about yet is how I'm going to do stuff like signal failure.
Let's run through how things could go wrong, and see what it would produce.
Suppose a have a value of unit type, and I attempt to coerce it to bool with a type ascription. Fundamentally, that's going to manifest as attempting a subtyping relationship between incompatible base types. The easy solution is for that to fail immediately. More involved would be for it to somehow embed information about the 1ML code into a coercion function that deliberately fails type checking.
Thinking about it rationally, I crowbarred in more advanced type-checking code after-the-fact in the IR layer, so there's no reason I can't focus this pass on ease of implementation, and then fix up the ergonomics after-the-fact, but I would like to have some idea of what interface I'm going to try to implement, at some point.
Anyway, it's late and I should wind down.
Good night.