Hello Swift community,
The review of SE-0475: Transactional Observation of Values ran from April 10th through May 13th, 2025. The Language Steering Group has decided to accept the proposal. This acceptance is inclusive of changes made to the proposal by the author in response to the review, namely that:
- The name of the introduced type in this proposal will be
Observations
. - All iterations of a specific
Observations
sequence will produce an initial value, not just the first iteration.
There was a good amount of discussion on this proposal and a lot of subtle edge cases to cover, so much of the review was spent probing the proposed semantics. The Language Steering Group is comfortable with the behavior of this sequence as explained in the proposal and elaborated on in review and think it fills an important ergonomic gap in the current withObservationTracking
API surface.
Some reviewers were concerned about the inherently async
nature of this API and called out problems faced by using this sort of API compared to a fully-synchronous API. The Language Steering Group is sympathetic to these concerns, and agrees that the shape of API proposed here may not be appropriate for every use case. Accepting the Observations
type does not indicate an unwillingness to consider other shapes of observation in Swift and the Language Steering Group felt that, especially with the name change, there was sufficient space being left to consider an alternate API in the future, if such a proposal ever arose. Moreover, the Language Steering Group felt that such an alternative would not obviate the need for Observations
as-proposed.
As always, thank you to everyone who participated for helping to make Swift a better language.
Freddy Kellison-Linn
Review Manager