In code quarterly interview with Rich Hickey, Michael Fogus hints that Clojure borrows a lot from Haskell:
Fogus:
As someone who only knows Haskell enough to read the papers, Clojure appears to be influenced by it substantially. From the names and operation of core functions—take, drop, iterate, repeat, etc.—to its protocols facility, there is a lot in Clojure that a Haskell programmer would recognize. Can you elaborate on Haskell’s influences on Clojure both positive and negative?
Hickey:
I think Haskell is a fantastic, awe-inspiring piece of work. I haven’t used it in anger, but it certainly was a positive influence. Haskell obviously goes much further than Clojure in pursuing the ideals of functional programing. In particular they differ in the approach to using types to enforce things.
My question is – Does Clojure borrow concurrency ideas from Haskell? Fogus hints at some syntax, and there is obviously functional laziness. What about the STM and concurrency operators?
Assumptions:
- I’m asking this question in a positive tone. I think it is great that Rich could see some of the treasures in Haskell and use them.
3
The vibe I’m getting is that the biggest influence on Concurrency in Clojure is Multiversion Concurrency Control – which comes from the database world. We see this with refs, which are part of the MVCC Software Transactional Memory.
What is interesting is the critiques of Clojure’s concurrency model by Martin Thompson. His claim is that ultimately the scalability model is limited by Amdahl’s law. This is as the refs depend on a Compare and Swap (CAS) operation – which is ultimately sequential, and will eventually become a bottleneck.