| ▲ | pie_flavor 3 hours ago | ||||||||||||||||
You may notice no language on the planet does this. That is because it is bad. Type guesstimation is a great way of ensuring random problems crop up in random places where they aren't expected and of making the typechecker much slower and more prone to unresolvability (see Swift's multi-minute compiles). All to save you from having to learn what an iterator is, in case you come from a language where lists are more common than iterators; the experience of being scared by a type, and then discovering that the type is not scary in chapter 13.2, is not actually worth making the simple type system instead staggeringly complicated. | |||||||||||||||||
| ▲ | onlyrealcuzzo 3 hours ago | parent [-] | ||||||||||||||||
> You may notice no language on the planet does this. That is because it is bad. Perhaps I've explained this poorly, but C#, Java, Perl, & Haskell (and I'm sure others as well) do versions of this already... You even seem to imply that Swift does, though I have almost no experience directly with Swift. The vast majority of times it is NOT ambiguous. The compiler can flag it, IFF you want it to. If you're coming from Python and you want to ease your learning experience, you probably don't want to hit several brick walls before you can do anything... If you have an enterprise codebase, you probably don't want to allow anything to be compiled that could be ambiguous, so you can force that mode of compilation (and likely should)... I don't know of any major language which have progressive modes of compilation like this. I think people will find it useful. Maybe it'll be a disaster. Time will tell. The whole point is to intelligent design the modes such that you can't ever get a MASSIVE surprise "upgrading" from one mode to the next, any error that is too hard to resolve basically automatically / through selecting options needs to be dealt with at the easiest mode. | |||||||||||||||||
| |||||||||||||||||