Coding 2025-08-14
I've been messing with music stuff (and Pipistrello) most of the day, but I did just now hammer out a rough prototype for the placeholder, or "failed" node classes. I defined the classes, and resolved some TODOs, and this has gotten me basically right up to the point last time where I said "and then I'm going to have to think about it".
There are basically a couple of things going on here.
- Bonus thing: the more inference methods I write, the more boilerplate I notice, and wonder if they should be written slightly differently.
- The new "failed" nodes could in theory be inserted "manually" into the AST, which would break the preconditions for type checking and inference, but do I want to put in the effort to surface that this has happened? What is a good/right way to handle this, in terms of generating constraint failures?
- I've got most of the infrastructure I need to create synthetic nodes when coercion fails, but do I want to insert a path segment to indicate the coercion? To be clear, the success case doesn't have a new segment, and I think that is correct.
- Can I formalize any design constraints on how type constraints are generated? Are there assumptions I can rely on about where different kinds of node came from?
Having written all of that down, I think the sensible way forward is to take a conservative approach, in various senses but not the political one, ew, cringe, and then, once I have a working prototype, start documenting and refining it.
For now, I've got to wind down.
Good night.