Hacker News new | ask | show | jobs
by emoII 416 days ago
And the typesystem is built in a way that it does not really help you due to typechecking being so slow. Make an error/begin refactoring in ocaml: just follow the typechecker until you’re done. Make an error/begin refactoring in swift: you plan ahead because the typechecker will crash with a timeout or give you non-root-cause errors.

Yesterday I changed the signature of a method, and instead of complaining at the callsites I got a ”ambiguous method” error for a built in SwiftUI view modifier. Kinda hard to track down if you’re not completely aware of the changes you’ve made

1 comments

This falls under the "new frameworks" category I glossed over. SwiftUI, SwiftData, etc, are failures in my opinion. SwiftUI in particular abuses the type system. In your own code the type system is very helpful.
If just about every big new framework in a language is a failure, what does that say about the language?
If you do a lot with combine publishers, then you might also have a hard time with the type system
Yep. If you’re writing good code that avoids common smells things are perfectly speedy. Usually if you’re making the compiler grumpy you should be sitting back and reconsidering your design anyway.
It has nothing to do with code quality: https://danielchasehooper.com/posts/why-swift-is-slow/
Hmm...getting strong "you're holding it wrong" vibes here.