π I just released Swift Streamable Actors v1.0!
If youβve ever wanted to observe changes to a Swift Actor's state as an AsyncStream without writing 30 lines of boilerplate for every property, this macro is for you.
Key highlights: β 100% Type-safe (no type-erasure/AnyKeyPath) β Memory safe (static factories avoid strong reference cycles) β Clean API: @Streamable does it all.
Check out the code: https://github.com/malhal/swift-streamable-actors
Looked at code using Swift Concurrency:
Immediately found a bug:
state = .working(progress: 0)
await doSomething() { percent in
state = .working(progress: percent)
}
state = .done
Whatβs the value of `state` now?
(βSurely `.done`β is the wrong answer)
Fucking Approachable Swift Concurrency
https://fuckingapproachableswiftconcurrency.com/en/
#HackerNews #FuckingApproachableSwiftConcurrency #SwiftConcurrency #Programming #DeveloperCommunity #TechNews
What do robot toddlers and coloring pages teach us about data races? First in a series building concrete mental models for Swift Concurrency. Feedback welcome!
https://krishna.github.io/posts/understanding-data-races-visual-guide/
Notifications crashing with concurrency errors? Replace unsafe πππ‘πππ¦() calls with ππ’πͺπ―ππ€π΅π°π³ππ¦π΄π΄π’π¨π¦ and ππ΄πΊπ―π€ππ¦π΄π΄π’π¨π¦. Thread-safe, modern, and built for async/await.
π https://www.avanderlee.com/concurrency/mainactormessage-asyncmessage-concurrency-safe-notifications/ by Antoine van der Lee (@swiftlee)
Struggling with protocol conformance across actor isolation boundaries? Swift 6.2 introduces isolated conformances and protocol isolation features that can be tricky to navigate. This step-by-step breakdown helps you understand when and how to use these patterns correctly, making your concurrent code safer and more maintainable.
π: https://www.massicotte.org/step-by-step-conforming-to-protocols by Matt Massicotte (@mattiem)
If thereβs one topic that I find intimidating, itβs protocols. They are very powerful and in extremely wide use. But Iβm sitting here, trying to figure out how to lead into this discussion and Iβm already getting overwhelmed. Thatβs because protocols can be incredibly complicated.
Are your singletons causing concurrency headaches in Swift 6? A breakdown of thread-safety challenges and practical patterns for making singletons work with modern Swift Concurrency.
π: https://www.massicotte.org/singletons by Matt Massicotte (@mattiem)
I see singletons used a lot in Swift projects. These things are, by definition, global state. That means they can be accessed from any context - any thread or actor - at any time. And this property makes them a common source of problems when used with Concurrency.
Want to adopt new Swift features without breaking your code? Swift's migration tooling is essential for safe, gradual transitions. Learn how to leverage it for upcoming Swift features.
π: https://www.avanderlee.com/concurrency/swift-migration-tooling-upcoming-swift-features/ by Antoine van der Lee (@swiftlee)