Coincidentally, someone posted a link to this message from 2002 where Xavier Leroy explains why they won’t implement multiprocessing in OCaml. It’s interesting to reconsider his arguments 8 years later. He says there are three reasons to use parallelism:
- Make use of multiple processors: OCaml does not support this.
- Overlapped I/O: Multiple threads can block on I/O, but only one thread can execute at a time. OCaml supports this.
- Coroutines: User-level scheduling or call/cc provides this. OCaml supports this.
So the only issue is #1. Towards the end of the message, he basically dismisses the idea that multiprocessors will ever be popular: “I believe [hyperthreading is] the last convulsive movement of SMP’s corpse.” He doubts that one could get good performance due to locking issues. Therefore, he says the extra implementation complexity just isn’t worth the small performance boost.
Today multiple cores are the primary way Intel/AMD will deliver higher performance. There’s demand for languages that can use cores efficiently (and provide nice abstractions). There are now many efficient concurrent runtimes and garbage collectors, many of which use lock-free algorithms. It’s still complex to implement, but not terribly so for the smart guys running the OCaml project. It’s still unlikely they would ever implement multiprocessing now, but new languages should tackle multiprocessing from the beginning.