Open goodboy opened 6 years ago
I've noticed many opinionated pronouncements about what does and does not constitute a true actor model:
trio
tasks don't adhere to certain actor behaviour requirementserlang
decided to implement an actor model system, yet there are many different languages, framework implementations, and variants that exist.After digging it seems to me that the theoretical core of an "actor model" is mostly well defined however in practise what does constitute being an actor model or system is somewhat flexible and less-stringent then many of the personal opinions on it (which seem to weigh one particular implementation or framework more when really the whole model is conceptual and implementation details are expected to vary).
Some resources to back this up include:
erlang
and scala
as examplesThe main distinguishing theoretical features of what constitutes adhering to the model seems to be rooted in 2 main concepts:
Another blog with some interesting posts: http://www.dalnefre.com/wp/
Notes on how CSP vs. Actor systems mostly has to do with asynchronous-ness and naming: https://en.wikipedia.org/wiki/Communicating_sequential_processes#Comparison_with_the_actor_model
As a reminder to self, I would like to have a "formal stuff" spiel in the docs going over the comparison and supposed incompatibilities of tractor
+ SC. By almost all measures tractor
is an actor model without having exposed some of the traditional apis/behaviour (message loops around channels, unbounded channels, names in every message) and still fulfills the core behaviors necessary for processes to be classified as "actors" (async message processing, inherent concurrency and parallelism, named based discovery, variable topology, async handshaking, async spawning, async "behaviors" used to handle each message, no assurance of message arrival order, locality, etc.).
One of the key points I'd like to make is just because we aren't enforcing "everything is an actor" (especially where it makes no sense) it doesn't mean you can't classify the system as actor based because, really each process running a trio
scheduler does fulfill 99% of the properties of a traditional actor even if they don't look like it from the outside.
Some TODO:
tractor
behavior and really the main difference between CSP and actors is the explicit requirement of channels which an actor model only rejects (as part of the core model) due to the "unnecessary overhead" that brings.trocesses
sounds terrible :smile: Some further inside from an existing systems perspective:
akka
which IMO looks exactly like SC especially when you dig into what behaviors are described as. If you don't think a coroutine in python suffices as an "actor" or behavior which provides a function on each resume to handle the next "msg", I think we have something disagree on. Taking this further to our tractor
"actors" - each process is able to respond, in an single threaded manner, to each new message that arrives by loading the appropriate trio
"task" to handle that message. This has nothing to do with SC which has to do with the lifetime and supervisory policies around these underlying "actor" abstractions.gerbil
scheme runtime has an RPC system that looks eirily similar to our IAC protocol. rando link from @salotz on The wide world of almost-actors: comparing the Pony to BEAM languages: https://www.youtube.com/watch?v=_0m0_qtfzLs&t=1s
cute summary: https://gist.github.com/rbishop/9082539
I think it's important to note (from the video) that messages have:
The atmost once could be pretty complex to implement as it's easier to sent messages multiple times than atmost once - because then you could loose/drop messages
@gc-ss
no guaranteed arrival order
this is incompatible with TCP
cannot get lost and
this is incompatible with the notion of UND in real systems
can arrive atmost once although they can arrive after a large time
Also incompat with TCP retransmission afaik.
I'm not sure any of those are strict requirements. Maybe you can point to where you think that is asserted?
The rant task is codified in #210.
This is a discussion thread to dig into the theory surrounding how this project is (like) an actor model system and how it is or isn't compatible with structured concurrency.
BEFORE YOU THINK OR READ ANYTHING ELSE.
Watch this vid by the original author of the theory if you think you know what an actor model is or does, or looks like: https://www.youtube.com/watch?v=7erJ1DV_Tlo
Hint: it's a computational model not an API.
A bunch of stuff that should probably be referenced in the docs and aluded to more formally in the implementation (if that's what we're after?):
Reference implementations in other languages and frameworks: