Swift Concurrency from Zero to Hero | Reading List
In this short post I want to recommend an ordered reading list that will get you from Zero to Hero in Swift Concurrency.
Each step is progressively and significantly harder than the previous one, and I expect 99% of readers to never reach the end. But those who do are guaranteed to become top 1% subject matter experts.
Disclaimer 0: I only included free and publicly available resources here, so you won't find materials from premium content creators here.
Disclaimer 1: This list is minimal by design. Think of each level as part of the Main Quest, with the expectation that youâll take dozens of side quests along the way.
Disclaimer 2: It goes without saying that just reading alone won't make you an expert, you'll need to continuously put everything you learn to practice.
Level 0ď¸âŁ
Fucking Approachable Swift Concurrency by Pedro PiĂąera Buendia
Easy and fun read with lots of playful analogies, a great introduction to the topic for folks who never dealt with Swift Concurrency before.
(Bonus)
Concurrency on Swift.org
You can't really go wrong with the official Swift Language Guide, but it's a fairly dry read even for a relatively informal "Swift Book" format, but some folks might find this preferable.
Level 1
Concurrency Step-by-Step: series by Matt Massicotte
These are practical and example-based guides. But unlike the hundreds of seemingly similar articles youâll find online, these go beyond simple recipes. They thoughtfully weave in insights and nuggets of wisdom that only a handful of industry veterans like Matt can offer. This is significant, because these tidbits will be coming back to you later in your journey as the dots begin to connect, carrying you to higher planes of understanding when you're ready.
(Bonus)
A Swift Concurrency Glossary
Another helpful resource on Mattâs website succinctly lists and explains each Swift Concurrency keyword and API. While it may be tempting to begin your journey here, I think itâs better to first encounter these concepts naturally in context, and then use this resource as a knowledge checklist and reference.
Level 2
Swift Concurrency Waits for No One by Saagar Jha
Now that you have sufficient vocabulary and user-level understanding of Swift Concurrency, itâs time to go back to the basics and re-conceptualise this knowledge around one of the main principles behind Swift Concurrencyâs design - forward progress guarantee. This relatively short article from Saagar packs a lot of punch. And it demands your full attention, with long pauses for pondering and tinkering. Don't hesitate to go on side quests the article might send you, or give it multiple reads until you understand what's written.
(Bonus Video)
Concurrency Hylomorphism by Lucian Radu Teodorecu.
This video has nothing, and yet everything, to do with Swift Concurrency. Lucian demonstrates a prototype language called Hylo that implements a concurrency model similar to Swift Concurrency's. By observing his process, youâll understand many design principles and underlying implementation details behind Swift Concurrency itself. After all, one of the best ways to understand how something works is to build it yourself, or at least see someone do it.
Level 3
Swift Evolution Proposals
Now, itâs time to put on a Swift language designer hat and read the original Swift Evolution proposals for the concurrency features youâve been learning so far. Most of them are filled with language designer jargon and are pretty hard to read. You donât need to understand every single detail, but try to give them your full attention.
But why bother with the proposals when you can just read the official docs? Because at this level, knowing the what and the how isnât enough. You also need to understand the why behind various concurrency features, the surrounding context, the alternatives that were considered, and the likely future directions. Remember, youâre not the only one on a journey. Swift Concurrency is on a journey of its own, and to be an expert is to be a part of it, even if only as a follower.
Here's the list of heavy-hitters:
Core features:
- SE-296: Async/Await
- SE-304: Structured Concurrency
- SE-300: Continuations
- SE-298: Async Sequences
- SE-317: Async let
- SE-311: Task Locals
Actors:
Isolation:
- SE-414: Region based Isolation
- SE-420: Inheritance of actor isolation
- SE-461: Async function isolation
- SE-466: Default actor isolation
Synchronization:
(Bonus)
Swift Concurrency Manifesto by Chris Lattner
To get an even bigger-picture view and find answers to the Ultimate Why behind Swift Concurrency, it can be useful to read the original Swift Concurrency Manifesto, which dates back to 2017. It's also fun to compare the early vision with the current state of the art.
Level đڏââď¸
Swift-Async-Algorithms on GitHub
Wait, what? Are we reading code instead of articles now? Yes, yes we are! We are officially at the "talk is cheap, show me the code" level. So go ahead, check out the repo in Xcode, and start reading and tinkering.
Why swift-async-algorithms?
- Itâs relatively small: at ~12,000 LOC, you can read the entirety of
Source/in a reasonable amount of time (and understanding howTests/work is a very interesting side quest, too). - High Swift Concurrency density. Almost every type and operation makes some Concurrency-related decision. The library pushes Swift Concurrency to its limits, and in some cases beyond.
- The core logic is well defined and universal: as long as you know how
debounceworks, you can skip the parts that encode these rules and focus only on concurrency decisions. You can learn these rules using marble diagrams like those at https://rxmarbles.com. - The library is written by people who designed some of Swift Concurrency features, so you're learning from the source (put intended).
Some useful questions to ask when reading the code:
- Why is this type
Sendable? - Why does this function have
sendingarguments / return value? - Why is this property
nonisolated(unsafe)? - Why is an unstructured
Taskspawned here? - Why is
UnsafeContinuationorUnsafeTransferused here? - Why is
Mutexused here, butLockused there? - How is cancellation handled here?
Final words
I created this reading list mostly based on my personal Swift Concurrency journey. Some of the articles I listed didnât exist when I started, so I used them as better replacements for what I originally read. I also likely missed some important resources that helped me along the way but slipped my mind. If you have recommendations of your own that fit into one of these levels, please share them in the comments below.
