Incrementally adopting strict concurrency in a preexisting project

Beginning with Xcode 16, Swift 6 is the new default language mode for new projects. For existing projects however, it’s likely you’re running Swift 5.10 or earlier. One of the biggest changes to Swift in version 6 is the new concurrency model, which enforces thread safety at compile time, rather than crashing or causing hard to diagnose bugs at run time. It’s a lofty goal from the Swift team, and one that I think is a step in the right direction, however, and this is a big hurdle, strict concurrency is hard. Adopting it in a new codebase is more straightforward (though the error messages are still inscruitable, not helped by the decline of StackOverflow), but migrating old codebases, especially in cases when Apple themselves have not updated system libraries, is considerably harder. ...

Sun, Oct 6, 2024 · Will Bishop