CommentComment

Note: Please read the update at the end of this comment!


Swift 5.10 is here! Holly Borla introduced the release on the Swift.org blog, and if you havenā€™t dug into what this release is all about yet, Iā€™ll let Holly explain by quoting the bolded sentence in her post:

Swift 5.10 accomplishes full data isolation in the concurrency language model.

As she explains, this is the culmination of years of work that will make our apps safer. In Swift 5.10, the feature to strictly check concurrency code is off by default and if switched on, introduces warnings, not errors.

The Swift Package Index isnā€™t the largest Swift project by a very long way, but itā€™s also not trivial, and it uses Swift concurrency extensively as a Vapor-based project, so I thought there would be no better way to test this than by enabling it on our codebase, so I did!

I followed this guide linked from Hollyā€™s blog post and had it set up in a couple of minutes. I expected tens or maybe hundreds of warnings, but found zero! So I did a clean build and again found zero warnings. Deeply suspicious! šŸ•µļøā€ā™‚ļø

I chatted about it with Sven, and he suspects that weā€™re in such good shape because of the work he did with the Thread Sanitizer from some concurrency issues we had last year. The Thread Sanitizer does a similar job to these strict concurrency checks but at runtime. We still run our tests with the sanitiser switched on today.

Just to check I hadnā€™t messed up while enabling the feature, I quickly inserted some code I knew should trigger a warning, and sure enough, one appeared! It seems the Swift Package Index source code is ready for Swift 6! šŸŽ‰

Since switching it on didnā€™t add any warnings, I even committed those changes so we wonā€™t accidentally introduce this class of error before Swift 6 arrives.

Checking for compatibility isnā€™t the only reason you would enable this flag, so why not give it a try to see how your apps fare? It only takes a minute to enable.


Update: I made a mistake here and used enableUpcomingFeature instead of enableExperimentalFeature. The real count of warnings was 526! šŸ˜± Be careful how you enable it!

Dave Verwer  

Code




Design


Books

Jobs

iOS Engineer @ trivago ā€“ trivago, a metasearch engine using real-time auction and petabytes of data, enables millions of travelers compare hotel prices from hundreds of booking sites. Based in DĆ¼sseldorf, we foster a culture of learning and innovation, embracing flexibility for our talents to shape the travel industry. ā€“ On-site (Germany) with some remote work (Anywhere)

Senior iOS/macOS Developer @ Paste ā€“ Joining Paste means crafting impactful, user-focused products alongside a team that values innovation, flexibility, and a culture of collaboration. Dive into projects that push the boundaries, enjoy freedom in how you work, and help shape the future of productivity tools. ā€“ Remote (within European timezones)

 

If youā€™d like to see your job featured in iOS Dev Weekly, post it on iOS Dev Jobs and select ā€œFeatured listingā€ as you check out, and itā€™ll be in next weekā€™s newsletter. šŸŽ‰

 

And finally...

This looks like fun, especially if you have kids.

Also, donā€™t forget you can already run Swift on a Raspberry Pi Pico! šŸ«Ø