I recently saw Chris Lattner talk about Mojo and he made passing reference to Swift trying to do too much with the type system. It’s telling that a guy with his experience is trying something more like zig’s comptime approach to types after two decades of generics.
Having worked on large codebases with many developers of varying levels of experience I have noticed that bugs that can be written very often will be written - a sort of programming specific version of Murphy's law. So I try to make the ones that seem the most likely impossible. Sometimes I go too far.
Yeah this is a very key point to reflect on. Is this stricter type actually catching a bug that's easy to make? Or is it just giving you more satisfaction of more precise typing? It takes time and practice to make that distinction.
Similar things can also be said about automated tests. I've written too many of them that end up being written for a mistake that never gets made.
Also curious about the delightful type generation Astro uses.