Daily Thought - 2024-11-09
< back to listImplementing a static type system for Caterpillar is not a preposterous thing to do right now. The language is still untyped, which was always going to be just a placeholder. And interactivity, the language's central premise, currently has a big hole, due to the lack of static typing.
So yeah, working on deploying games to websites would still be more important, but I figured, let's just see how hard this can be. And since my plan is to center Caterpillar's type system around type inference, I didn't want to design a type declaration syntax as a stopgap. How hard can a fully inferred static type system really be? Down the rabbit hole I went.
And as it turns out, most of it isn't that hard. I had a compiler pass working quite quickly, that can infer the types of most expressions. But there's one very tricky part, and that's type inference of recursive function calls. I'm still working on that.