Has Swift's concurrency model gone too far?

This is something I think about a lot. Are these things you truly need to know to be successful? I think it is 100% natural to want to understand everything. You're looking at documentation for an essential API. How could it be you can use this without knowing exactly what each of these does?

I believe it actually is unnecessary and usually just a distraction.

Take the @isolated(any). It gives the callee (Task.init here) the ability to inspect the static isolation of the function argument. So in this case, there's this scary-looking annotation that, as far as I know, does not have any impact at all on callers.

Making things worse, this particular constructor is actually even more complex than you are seeing in the published documentation. I think discussions around ways to simplify/streamline/sugarize syntax here is worthwhile. I have some ideas, but I'd love to hear more!

So I guess I'm saying that I'm skeptical documentation alone will ever be able to overcome complex syntax. Yes, that syntax exists for a reason, and you cannot just eliminate it without giving up power. But that syntax also makes some APIs pretty darn intimidating.

12 Likes