Concurrency in Swift 5 and 6

At this point, there isn't much in the way of new language features we need to do here. Rather, it's a matter of rolling out Sendable checking throughout the ecosystem (something we'll have to do incrementally, and enabling more dynamic checks to deal with places where code that is outside the model (C code, Swift 5 code that hasn't enabled checking, etc.) could introduce problems.

Now, I'm not completely happy with how Sendable interacts with some parts of the language (a few of those issues are mentioned here), but the general model is sound.

The major missing piece for the language is that we currently don't have anything that bans access to mutable module-scope or static variables. I suspect that's a small change (in terms of language design), and the implementation has some latent code to outright ban it, but nobody has come up with a proposal thus far.

Doug

12 Likes