The review of SE-0316: Global Actors has concluded, and the core team has decided to return the proposal for revision. There were several points of feedback that the next revision should address:
- As one of the authors notes, and as was suggested by @anandabits in the first review, it is useful for
GlobalActor
to be a formal protocol instead of an ad-hoc attribute. This allows for code to be generic over global actors. -
@Chris_Lattner3 notes that the treatment of mutable global and static variables in this proposal is incomplete. As written, the proposal ambivalently states "we can require" globals to either be annotated with a global actor or be
nonisolated let
s, but the handling of globals is a big design space that should be explored in its own proposal. The global actors proposal should not try to address it at this point. -
@gwendal.roue raises a question about how
@MainActor
code interacts with code that is dynamically already running on the main thread. It is important in many situations to avoid inserting a hop before code that runs on the main thread, and in practice, the@MainActor
executor implementation already dynamically checks whether code is running on the main thread before scheduling a hop for main actor code. The proposal should be revised to promise this. - @beccadax requests a clarification of the grammar of closure attributes relative to other parts of the closure syntax.
The review discussion during this round also did not provide much comment about the inference rules for global actors. These are rather intricate and subtle, so the core team would like some more feedback on how well they work in real-world code.
Because Juneteenth weekend is starting tomorrow, June 18, for many U.S. developers, I will schedule the next review to begin next Monday, June 21. Doug has already revised the proposal to take the above feedback into account.
Thanks to everyone who participated in the review!