How would one implement an actor-based concurrent language in ruby? My thought is that only the correct way of creating programs is using actors, but I'm not entirely sure on how this could be done, and how the syntax/grammar could be, but I'm fond of the idea. I will use Ruby together with rdparser and celluloid (for actor implementation). My point is not to make it really "useful" or implement my own version of actors, more trying to create a functioning language based on concurrency with actors. Looking for examples, point to the right direction if this is even plausible.
First I am pretty biased against institutionally taught programming, and this is one of the reasons why. Now I just wanted to state that, so you can take this answer with a grain of salt.
Actors are a theoretical construct. They "can" mean what ever you want. At it's core actors are things that do things. Usually in a program focused on concurrency, an "actor" is an analogy for a unit of work that can be segmented off from the other units of work in such a way that the program will still function rather or not the actor is called, what order it's called in, or if it takes a really long time to do it's unit of work.
Take an import process. An actor could
- open the file
- read it line by line
- Transform the data
- close the file
This may be the import actor.
The read it line by line may be another actor, as well as the transform "unit of work" may be an actor. However, the open, and close calls can not be "separate" actors. You can not close the file, then read it line by line.
In other words. Actor is just a thing. A name for a way of doing things. It's a theory, a way of modeling a process to do stuff in a way we humans can understand. It may help us understand and "flesh out" what we are trying to do, but in the end it's just a "do-hickey" A construct that you as the programmer can implement.
Now that said, there are some tools that can help with concurrency. https://github.com/celluloid/celluloid for example helps. https://github.com/ntl/actor may be something to look at. But keep in mind, that actors are not a real thing, they are a pattern, or a model and while some gems may help you with messaging or threading, there is no single hard and fast setup that is an "actor".