I stumbled upon the the news that the Clean compiler will support Haskell. While Haskell is not in the Beta version of Find It! Keep It!, it will be after 1.0 (see The Haskell Communities and Activities Report).
Why am I excited? Clean’s compiler produces faster code than GHC making it real competition. But in the longer term, because I personally still feel IO is an unresolved problem in Pure Lazy Functional Languages:
- In the early days of Haskell everyone (including me) used continuation style: Every function doing IO needs to be passed the next function to perform, and some functions “magically” have side effects. Because Haskell is lazy, this was very painful in practice as you had to know what would be evaluated when: there was no guaranteed order in which I/O would occur.
- Monads rescued Haskell with a much more imperative notation: do this, then that. They guarantee ordering by restricting the ways in which you can use them, and hide all the nasty side effects (I/O) under the covers. While less painful than continuations, you end up with different domains for each monad you use and another domain for purely-functional code. Mixing code from different domains requires paying a Monad Tax: for Monads, managing a Monad Transformer Stack (I wish I was kidding) and for purely-functional code, sometimes having to change its signature and rewriting it in terms of monads instead. (see SPJ’s slides)
- Clean solved the problem with Uniqueness Typing: you pass the world around as an object, and do things to it. Uniqueness Typing guarantees there is only one order in which I/O will occur, but retains the standard functional way of writing code.
I don’t really like using Monads. I’m hoping that making Clean & Haskell linkable will lead to advances in this area. Perhaps some combination of Monads for some problems, and Uniqueness Typing and Implicit Parameters for other problems, will improve the situation.