- As one of the authors notes, and as was suggested by @anandabits in the first review, it is useful for
GlobalActorto 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 lets, 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
@MainActorcode 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
@MainActorexecutor 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!