3 ms·
According to https://github.com/apple/swift/blob/6d2a3bbf9d518c2ff8c637313d1a459f40e5d6bc/docs/TypeChecker.md https://github.com/apple/swift/blob/6d2a3bbf9d518c
by lilyball 4y ago
According to https://github.com/apple/swift/blob/6d2a3bbf9d518c2ff8c637313d1a459f40e5d6bc/docs/TypeChecker.md https://github.com/apple/swift/blob/6d2a3bbf9d518c2ff8c63731...
> The Swift language contains a number of features not part of the Hindley-Milner type system, including constrained polymorphic types and function overloading, which complicate the presentation and implementation somewhat. On the other hand, Swift limits the scope of type inference to a single expression or statement, for purely practical reasons: we expect that we can provide better performance and vastly better diagnostics when the problem is limited in scope.
However Hindley-Milner systems are generally linear in complexity whereas Swift's type system experiences combinatorial complexity explosions in the presence of overloads and operators and literals.
- saghm 4y agoYeah, it makes sense that they have features that make it harder. I can't say that it's the _wrong_ choice, but it's enough to remove any potential remaining interest I might have even if it did reach the level of support on Linux that I would otherwise want. I honestly prefer not having function overloading, and I certainly wouldn't want to give up features that I actually would want to use to be able to have it be supported in a language.