Comment by EdNutting
6 hours ago
How closely is BEAM/OTP related to the foundational work on CSP (and the implementation in Occam/Transputer way back when…)?
6 hours ago
How closely is BEAM/OTP related to the foundational work on CSP (and the implementation in Occam/Transputer way back when…)?
Good question! It's a bit of a stretch. BEAM has mailboxes, non-blocking sends, and asynchronous handling of messages, whereas the original CSP is based on blocking sends and symmetric channels. Symmetric means you have no real difference between sends and receives: two processes synchrnoise when they are willing to send the same data on the same channel. (A "receive" is just a nondeterministic action where you are willing to send anything on a channel).
Occam added types to channels and distinguished sends/receives, which is the design also inherited by Go.
In principle you can emulate a mailbox/message queue in CSP by a sequence of processes, one per queue slot, but accounting for BEAM's weak-ish ordering guarantees might be complicated (I suppose you should allow queue slots to swap messages under specific conditions).