CommentComment

I’ve heard many people echoing Alex Grebenyuk’s thoughts about Swift 6 language mode recently. It’s a long post, but it’s worth reading. Give it a read and come back.

What Apple is doing with Swift 6 language mode is bold, and if it works, there’s a clear and significant upside. Swift apps will benefit from fewer crashes and unexpected behaviour. But, as Alex and the others who messaged me point out, using the new language features correctly puts a significant burden on developers, and this is especially true for those maintaining larger apps.

One of the problems with designing a language intended to scale from embedded systems, through every modern computing platform, to the largest back-end systems chock-full of concurrent code is that not all those use cases need all the language’s features. Swift’s answer to that has always been progressive disclosure, and it works well. You could go through a great many Swift tutorials and even publish an app to the store without needing any concurrency. You will need it at some point, though, and unless you’re experienced with understanding data races, you’ll likely hit a fairly steep slope with the warnings/errors produced by Xcode. The grumbling I hear isn’t coming from novice developers, either. For example, from Alex’s post:

There’s also been a notion that the new warnings are easy to fix. I’m sure some of them are, but that wasn’t the case in my experience. In my frameworks and apps, I had to carefully think about almost every individual instance and then often update tests, etc, which was extremely time-consuming even in smaller well-maintained codebases. Migration seems easier once you’ve done it, but at this point, it’s too late. I wouldn’t underplay how complex it is, especially anything related to closures and delegates.

It’s important to note that no one is forcing anyone into adopting Swift 6 language mode, where the concurrency warnings turn into errors. You can continue with Swift 5 language mode. But what happens if significant numbers of people choose that path permanently? I’m confident Apple has thought about this possibility and has a plan, but it has the potential to be a messy situation.

Don’t get me wrong, I’m not calling this a failure by any stretch of the imagination. We’re only 5 weeks into Swift 6's beta. There’s plenty of time before anyone needs to worry about people who might choose never to switch. I hope it’s also clear that I hope the bold move succeeds. There are also possibilities for Apple to do more work to ease the transition, and not only in the few weeks we have left until a 6.0 release, but onwards into 6.x releases. As many people often like to joke when Apple releases something new, this is the very worst version of data race safety checks that the Swift compiler will ever have! 😂

I have no conclusion to make here. Like I say, it’s way too early to call it either way, but it’s definitely worth listening to developers who are raising warning flags and writing blog posts like Alex’s.

Dave Verwer  

News

Tools

Code




Business and Marketing

Jobs

Software Engineer, iOS @ amo – Amo values speed, creativity, and high performance. Focused on meaningful social apps, they prioritize creation over consumption and simple, fun experiences. The diverse, skilled team uses a modular monorepo tech stack with Rust, Bazel, and RxSwift, leveraging efficient data processing on GCP. – On-site (France)

Product Engineer (iOS, Full-Stack) @ Emerge Tools – Have a huge impact working with our small, technically elite team (just 8), build tools used some of the biggest & best mobile teams in the world (DoorDash, Square, Spotify, Duolingo, Tinder, Bumble) – Remote (within US timezones)

Senior iOS Developer @ Komoot – Your work will contribute to helping millions of people enjoy lovely outdoor experiences and you can work from wherever you want, be it a beach, the mountains, your house, or anywhere else that lies in any time zone between UTC-1 and UTC+3. – Remote (within European timezones)

 

And finally...

I didn’t think I’d watch a 20-minute video on building a keyboard, today, but I did! ⌨️