Matt Massicotte from Chime discusses challenges faced migrating Async/Await and misconceptions with asynchronous programming. Topics include: limitations of Extension Kit, transitioning to Async systems, introducing concurrency to a stateful system, purpose of actors in protecting mutable state, and concurrency challenges in Swift.
The challenges faced in migrating to Async/Await and the importance of explicit dependencies to enforce order in stateful systems.
The compatibility issues encountered when using older APIs with async/await and the need for improvements and updates to these APIs in future releases.
Deep dives
Extension Kit Updates and Challenges
Despite some issues and lack of updates regarding Extension Kit, the speaker had hopes for improvements in this area. Extension Kit was introduced with no mention in the release and was expected to launch for iOS but got delayed. The presenter highlights the weirdness in adding it to macOS when most of its features were already feasible before. Although some portions of Extension Kit are available on iOS, they are not enough to be functional. The overall situation regarding Extension Kit has remained the same with no significant changes.
Async/Await Quirks and Issues
The speaker shares their experience with async/await and the challenges they faced while working with Extension Kit. They initially found it easy to replace completion handlers with the async keyword, but as they integrated concurrency into their app, they encountered problems with race conditions and lack of ordering. They realized that without explicit dependencies, tasks run in any order. The speaker discusses the issues of concurrency in stateful systems and the need for explicit dependencies to enforce order. They also mention the use of global queues as a stopgap solution to address race conditions.
Compatibility Challenges with Older APIs
The presenter discusses the compatibility issues they encountered when using older APIs in conjunction with async/await. They mention an example where an API in HealthKit was introduced as async but lacked the necessary support for sendable types. This highlights the need to ensure compatibility between older APIs and async/await. The speaker also mentions the challenges of NSOperation and maintaining code that uses older Objective-C APIs while migrating to async/await. They express interest in improvements and updates to these APIs in future releases.
Upcoming Swift Changes and Considerations
The speaker mentions some upcoming changes and considerations in Swift, such as the focus on primary associated types, improvements to the text system, and the introduction of macros. They express interest in how these changes will address existing challenges and offer potential solutions. Additionally, the speaker acknowledges the complexity of Swift and encourages developers not to be intimidated by it, emphasizing that efforts to solve fundamental problems within the language are important and necessary.
Matt Massicotte from Chime talks about the challenges he faced migrating the Async/Await and some misconceptions folks might have with asynchronous programming.