Get the latest tech news

Why Swift's type checker is so slow


How a 10 year old design choice for Swift’s type checker still haunts us to this day

My experience with Swift is we tried to make a really fancy bi-directional Hindley-Milner type checker and it’s really great because you can have very beautiful minimal syntax but the problem is that A) compile times are really bad (particularly if you have complicated expressions) and B) the error messages are awful because now you have global constraint systems and when something goes wrong you have to infer what happened and the user can’t know that something over there made it so something over here can’t type check. This might be a reasonable stopping point: teams that care about compile times and good error messages could use the flag, and everyone else doesn’t have to. As a result, we’d get faster compilation times and clearer error messages, but the extra verbosity might be too much for the swift community to swallow.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Apple

Apple

Photo of biggest flaw

biggest flaw

Photo of Swift

Swift

Related news:

News photo

The best small updates Apple didn’t mention at WWDC

News photo

This Week in AI: Apple won’t say how the sausage gets made

News photo

Apple surpasses Microsoft as most valuable company