Re:Swift type checking is undecidable
by Someone on Tuesday August 04, 2020 @12:23PM
(#24051485)
No. This probably is similar to the definite assignment problem (https://en.wikipedia.org/wiki/Definite_assignment_analysis) in the sense that the problem for the current language is undecidable, but you can pick a usable subset of the language in which it is solvable (Java picked a very small subset for the definite assignment problem, making it very easy to implement that aspect of the language, without losing much expressiveness in practice)
If so, the main question the developers of Swift face is to decide in what way(s)/how much to constrain the current language.
A side effect of that could be that the compiler gets faster because the type checker will no longer have to consider some dark corners of the type system that were removed from the language.
If so, the main question the developers of Swift face is to decide in what way(s)/how much to constrain the current language.
A side effect of that could be that the compiler gets faster because the type checker will no longer have to consider some dark corners of the type system that were removed from the language.