I’m not a hugely experienced programmer, just a few years. So I’m looking for resources to learn about a topic but I can’t seem to find much out there. Maybe someone here can point me in the right direction, here’s the topic.
I can see that using actors makes a program more generalizable, meaning, it can be deployed across nodes more easily. But I have this inkling that I don’t know the high-level design patterns that make a program more generalizable (as in, the code is able to be changed without introducing unintended consequences).
It seems as though actors are an abstraction over the typical sequential, linear type, procedural programming that I’m familiar with. But I’ve yet to find someone or some resource that can say, “Here’s how it’s different, programming with actors and here’s how to take advantage of the abstraction.”
Are there different design patterns when programming only with actors?
If such design patterns are immature or lacking in some way, could such patterns be developed if perhaps these kinds of systems used distributed consensus to ensure each node knows the order in which each message was sent? I wonder if perhaps that’s an element to truly generalizable code that hasn’t been embraced yet (I, of course, don’t know, that’s just my intuition).
Does anyone have any good resources for me?
Maybe to give an example of what I mean I’ll try to describe a common problem in programming:
You’ll have a system that should behave in some way if it receives a certain input:
if input_A do response_A
that’s easy, but what if, in a particular context you want it to do something else?
if input_A do
if context_X do response_B
else do response_A
I just have this feeling that this kind of arbitrarily complicated logic can naturally fall out of a simple abstract structure of self-interested actors, instead of explicitly coding it, but I don’t know how exactly to program that way. Am I making any sense?
I’ve been searching for “building generalizable program flow with actor model” or “abstracting logic with actors” and stuff like that but I’m not finding the kinds of answers I’m looking for. I mostly get articles and videos explaining what an actor model is, which isn’t helpful.
It’s frustrating because I have this intuition about what’s possible, but I can’t find any resource that can tell me how to get there. Do you sympathize with me? Do you feel the same way? Am I missing out on some big secret that every erlang programmer knows? Or am I just up in the night?
I guess what I’m trying to say is that in a procedural language unintended consequences of complex code is always a negative thing, it’s always a bug to be avoided since you as the programmer must manage everything explicitly. But it seems to me, with the actor model and the abstraction it provides, there should be a way to organize them to leverage those complex interactions to naturally and continually maintain the overall desired state of the system. I don’t think it’s magic, I just think we should be able to naturally harness that power in some way with this additional layer of abstraction. But how?
Anyway, thanks for your attention and any feedback you may have.