5 ms·
I'm also intrigued where the Actor model will leave Combine. Are they designed to work together? Many of the Rx based architectures (The Composable Architectur
by tcldr 5y ago
I'm also intrigued where the Actor model will leave Combine. Are they designed to work together?
Many of the Rx based architectures (The Composable Architecture in Swift, React, Cycle.js, etc) that have appeared – all inspired by Elm (itself inspired by Erlang/OTP?) – seem to lean on a kind of pseudo actor model where messages are passed into a kind of 'actor', its state is modified, side-effects are initiated and performed asynchronously, and subscribers are updated in turn.
With the Rx based architectures at least this created a lot of boiler plate and the need to create a separate enum just to pass messages into the monad with a big switch statement to route them all.
Now, if I understand correctly, this actor model would facilitate a very similar workflow but without an additional dependency and far less boilerplate.
Instead of passing messages into the 'actor' via a messages stream – you can just call methods on the actor. Then, an actor can manage a 'state' property internally and simply forward changes to that state to via a publisher (PassthroughSubject/BehaviorSubject).
That would be pretty nice!
- jb1991 5y ago> all inspired by Elm No, Elm is just another implementation, not the invention.
- weehoo 5y agoWhat is the invention? Honest question, not familiar with this stuff. Comments make it hard for non-experts to follow the discussion.
- tempodox 5y agoCarl Hewitt's Actors: https://en.wikipedia.org/wiki/Actor_model https://en.wikipedia.org/wiki/Actor_model
- ProfHewitt 5y agoUnfortunately, the Wikipedia article (that I wrote many years ago) is way out of date :-( See the following for Actors: https://papers.ssrn.com/abstract=3418003 https://papers.ssrn.com/abstract=3418003
- jb1991 5y agoWith regards to Elm and some others, you have Functional reactive programming, reactive programming, Rx, it goes by a variety of names. It’s most famous for transforming UI development some 8? 10? years ago with the widespread adoption of React. But it’s been around longer in various forms. Implementations can widely vary but the general concepts are very similar. Actors are something different.
- tcldr 5y agoWell, it seems to me that the creators of the mentioned frameworks cite Elm as their inspiration – even if it wasn't the genesis of the concept.
- jb1991 5y agoOne of those frameworks you mentioned is React, so that’s not quite true. Elm is cited in things like Redux, but React was first deployed on the Facebook website a year or more before Elm was even first released. And FRP has been around much longer.
- mojuba 5y agoI'm also wondering whether SwiftNIO will be rewritten to use actors, or it will stay "old-school" for the sake of efficiency. Very much looking forward to Swift maturing for backend development either way. It's an amazing, rich language with the only drawback of the compiler being shamefully slow (though it's probably not that bad on Linux, where there are no legacy ObjC frameworks). Other than that, I love the idea of having an ARC-based modern type-safe language on the backend, possibly with the new concurrency model being at the core of the network framework.