The one spark of genius in the madness that I'll credit myself with here was to lean on the LSP for all the type resolution parts. (Also I'm glad I read Crafting Interpreters a few years ago so that IR and AST are things I know just enough about to get by)