|
|
|
|
|
by kjaleshire
1778 days ago
|
|
Swift actors seem to differentiate from other actor implementations (see Erlang) which have a decoupled message queue. Calling into a Swift actor may be non-blocking, but the result must still be await'd and from the actor's perspective all calls are sequential and synchronous. By this token, actors seem to be the language-level implementation of a class where all methods are asynchronous, and also being protected by the same lock. The novel feature seems to be cooperative scheduling amongst actors. |
|
My enduring impression after learning Swift Actors is that a LOT of additional complexity is introduced because of reference types. The data inside an Elixir process is just that: data, but the possibility of the data in a Swift Actor being a reference to a class suddenly makes everything complicated.
Regardless of the technical achievement from a compiler perspective I found that Swift’s Actors didn’t map well to my understanding of them from Elixir/Erlang and that they weren’t a net positive for solving the kinds of problems actors are suited for. I’ll concede this is all very personal and subjective though.