Actors Are No Longer Toys!

"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
https://github.com/dbmcclain/Lisp-Actors/tree/main
dbmcclain/Lisp-Actors: Thread-agnostic Actors in Common Lisp
github.com
-- 19 Jan 2025 -- Graduation Day!!
 <https://github.com/dbmcclain/Lisp-Actors#---19-jan-2025----graduation-day>
Actors programming has graduated with flying colors. I claim this technique is no longer a toy.

We have, now, several instances of applications for Transactional Hewitt Actors:

  1. A fully asynchronous network interface including on-demand connection negotiation with secure key exchange, refutable double-ratchet message encryption. and connection retiring. Actors are unaware whether they are sending messages to local Actors, or to remote Actors. They look the same, with local proxy Actors being automatically generated on each side of the connection to serialize message flow across the network.
  2. A highly parallel audio loudness analyzer capable of sniffing out all audio tracks on the computer and running parallel analyses and database updates for loudness time profiles on every track. This performs analyses against 12 hours of playback in about 2 minutes. In addition to the analysis engine, there is a GUI layer for graphic presentation of database updates, and ad-hoc user browsing.
  3. A realtime data acquisition and precision frequency analysis system with hard realtime requirements for the data acquisition. Includes a GUI layer, direct data acquisition tasks, intermediate phase-coherent buffering so that higher level analyses can work with artifact-free data, telemetry generation and encoding/decoding in a sub-band, IRIG-B timestamp recovery, and data recording with deferred playback.
  4. Live remote telemetry monitoring, and control, of an audio plugin for specialized sound crafting. While the plugin is in use on one computer, another computer on the network can watch live telemetry, in graphical form at 25 Hz update rate, of the internal operations of that remote plugin operation. Operational parameters can be remotely changed and the live display shows their immediate effects.
  5. A fully automated Astronomical image analysis and differential photometry system. It paralellizes the analysis of large images, performing image filtering, object detection and measurement. The system is self-calibrating by matching with a parallel query to the Simbad database located on servers in Strasbourg, France, downloading matching star fields from the Gaia catalog. A live carographics display is formed, where mousing on a star reveals its measured magnitude and detection statistics.

Each of these applications are real-world, and would have been an unholy nightmare to program with threads, locks, function call/return only. They would have been a tangle of callbacks and a bookkeeping fright.

Simple asynchronous message passing is all that is required. No threads, no locks, no callbacks, no Async/Await. They run as well on a single threaded CPU, or on a fully SMP parallel multi-core system. Messages are free-form, and can contain anything. Pattern matching in the Actor behavior code further dispatches incoming messages.

Many people confuse Actors with message flow - thinking that every Actor must have its own mailbox. I claim otherwise. Transactional Hewitt Actors are simply passive functional closures that respond to messages when delivered to them, wrapped in a single level of indirection. The 3 primitive operations that must be supported are SEND, CREATE, and BECOME. Transactional Actors respond to messages either without error, or else not at all. No visible state change occurs until an Actor's code exits successfully.

There is a separate mechanism with a shared communal event queue for message passing, and a pool of messsage dispatch threads below the surface that arrange to deliver messages to Actors, detect state mutation collisions with automatic message delivery retry, and to enforce their transactional behavior.

Actors support fully parallel concurrent activity. The are exceedingly simple to use for making your code behave with a high degree of parallelism, without any complicating factors such as thread control, critical section locking, mutexes, etc. You program as though you are the sole occupant of the machine, but with an eye toward purely functional style. No shared data to worry about, except that if this data is globally visible, you mustn't mutate it.

The Transactional Conventional Hewitt Actor paradigm has real teeth!!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.