top | item 46845719

(no title)

willtemperley | 28 days ago

I'm just talking about having some mechanical sympathy for the compiler such as understanding where the constraint solving problem space gets very large.

I wasn't saying use explicit types everywhere, but giving the compiler a hint every now and then to make things faster just makes sense. The Swift compiler is very complex and of course there are edge cases where it struggles with legal syntax, such as large expressions with many operators.

With SwiftUI it's arguably more important because view builders already put a lot of strain on the compiler.

discuss

order

JackYoustra|27 days ago

You can't really easily use explicit types in much of idiomatic SwiftUI. The expression that the compiler is trying to solve is really complicated, I agree, but the solution to that is either changing how SwiftUI is architected or restricting how the language built on SwiftUI infers types.