Concurrent Programming in ML
I have added concurrency to the functional language Standard ML. The model of concurrency is derived from CSP, but processes do not communicate directly; they interact by communicating over channels. Also, processes and channels can be created dynamically. Three features of Standard ML - polymorphism,
garbage collection, and modules - work exceptionally well with concurrency. Polymorphic functions that combine the concurrent primitives can be used in many programs. One can write processes that do not explicitly provide for their own termination; the garbage collector reclaims them when they can no longer communicate. Finally, one can use the Standard ML modules system to make small
adjustments in the meanings of the primitives. The implementation takes only 220 lines of Standard ML. It uses call with current continuation, callcc, to simulate concurrent execution on a sequential machine. callcc is implemented efficiently by the Standard ML of New Jersey compiler, which uses no runtime stack.