First published at 11:15 UTC on September 22nd, 2018.
The chemical machine paradigm can be understood as a modification of the Actor model where the "chemical actors" are type-safe and are automatically managed by the runtime system.
I show that all the features of the chemical machine logic…
MORE
The chemical machine paradigm can be understood as a modification of the Actor model where the "chemical actors" are type-safe and are automatically managed by the runtime system.
I show that all the features of the chemical machine logically follow from this single requirement, together with the idea of waiting for messages from multiple mailboxes at once. In particular, it is necessary that the actors become stateless (all data resides on messages); that mailboxes become unordered multisets of messages, rather than ordered queues; and that the parallelism of the computations become an automatic feature provided by the runtime, rather than being managed explicitly by the programmer.
In this way, the chemical machine paradigm improves upon the Actor model, freeing the programmer from the need to manage the actors' lifecycles and mutable states, and making the code more purely functional and more declarative. The programmer can design a chemical machine program by reasoning directly in terms of data that resides on messages in mailboxes, rather than having to handle multiple running processes and their mutable states, as it is still necessary in the Actor model.
I also show how programs written in the Actor model can be directly and straightforwardly simulated by chemical machine programs.
This tutorial is based on a chapter from "Concurrency in Reactions", a tutorial book on `Chymyst` and Chemical Machine programming: https://winitzki.gitbooks.io/concurrency-in-reactions-declarative-multicore-in/content/
Main repository for the `Chymyst` library: https://github.com/Chymyst/chymyst-core/
LESS