Following the examples of Pike's Newsqueak and Hoare's CSP, I have added concurrent primitives to ML, using the Standard ML of New Jersey compiler. The primitives provide dynamic creation of processes and channels and synchronous communication over channels. Input and output (to the Unix file system) is available on the same footing as communication over channels. I use SML-NJ's callcc and throw to simulate concurrent execution on a sequential machine.
Concurrent programs can be structured as large collections of simple processes. I present several example processes. Because they are polymorphic (i.e. they operate on values of any type), these processes can be used in many programs. I present an application that uses these processes. I comment on the implementation and suggest how it might be extended to run on a multiprocessor. I show how the Standard ML modules system can be used to effect changes in the meanings of the primitives.
The full paper is available in PostScript form.