<-- fasto
--> compiler
Game plan
Since the interpreter is built on F#, it makes sense to use F#'s own modules for implementing our concurrency model instead of building from scratch. In particular F# provides the MailboxProcessor class, which is built on top of its async programming model for asynchronous workflows.
So our task is to:
-
First build the concurrency model in F# using MailboxProcessor.
-
Then use that as a module for our interpreter.
-
Finally we can define each expression (spawn, send, receive, channel and await) in the interpreter calling the respective functions from the module.