DEV Community

aayush
aayush

Posted on

Why we don't have actor model instead of promises in JavaScript (or Nodejs).

Would love to have a productive discussion on this.

Please leave your thought in the comment sections.

Top comments (1)

Collapse
 
mremanuel profile image
Emanuel Lindström • Edited

I would say that the actor and message abstractions are unnecessary in most(?) occasions.

If you have a complicated system with lots of state change it might be a good way to set it up as a whole. But if you just need a few state changes and async actions here and there, building an actor-abstraction might be overkill.

I like the actor model too (I assume you do). It's simple to reason about and makes sense. But so does object oriented programming, and that can be a horrible choice for some type of systems. To understand the actor model better, I would be interested in hearing in what scenarios the actor model fails.