Haskell vs. Clean

ana ana@ufu.br
Sat, 20 Dec 1997 00:07:35 +0000


Philip Wadler wrote:
> 
> Erlang has been used for mission critical purposes, namely
> phone switches (which sell for millions of kroner).
> 
> You can find applications of the sort that interest you listed in
> 
>         Real-World Applications of Functional Programming
>         http://www.dcs.glasgow.ac.uk/fp/realworld/
> 
> This lists serious applications of Erlang, Haskell, SML/NJ, CAML, and
> others.  I couldn't spot any listings for Clean -- so the Clean people
> should please get off their duff and submit something!  -- P
> 
Dear Dr Wadler.
I am new in the functional programming world. I learned the trade from a
book written by you. The first language I tried was Haskel (GHC). I
found it large to download, difficult to use, difficult to install and
slow. It requires a C compiler, and I wanted functional programming to
get away from C. I need to qualify the word slow. I work with signal
processing for natural language analysis, and this requires a lot of
number crunching (systems of linear equations, wavlets, FFT, etc), and
symbolic processing. My programs in Haskel turned out to be 10 times
slower than the programs in C. Besides this, I was forced to use much
smaller samples. I suppose that a person which knows Haskel well would
do a much better job than I did. A Haskel programmer would use
strictness analysis and things like that.

After trying Haskel, I tryed ML. It was almost as slow as Haskel. I
tryed Erlang also. It is 30 times slower than C! At least, this is the
case of the PC version.

I am not fond of Clean. However, it was the only functional language
which I was able to use in order to get away from C. Sometime in mid
july, I spoted a compiler for windows in the Clean page. The file had
around 1000 K bytes. Much smaller than GHC, SML/NJ or MLWorks. So, why
not to download it? Thus, I translated a small Finite Element program
from C to Clean. The compiler was very easy to use. I didn't need to
fish for a C compiler from the site of Cygnus, I didn't need to install
an assembler, nothing. I unziped the distribution file, and I was ready
to go. The syntax and semantics were close enough to Haskel, so my
learning curve was very steep. Well, I compiled the finite element
program, and since it takes 82 seconds to run in C (Compaq 4172-166Mhz)
I was prepared to wait at least ten minutes to get the answer from
Clean. To my surprise, I got the answer in 88 seconds. Almost as fast as
C! Then, I introduced the strictness exclamation marks every where. I
filled the program with !!!!!!!!. The time went down to 78 seconds.

I don't know what people mean by real world application. Any program
which a person uses for getting a result is a real world application.
Even my small finite element programs, Fast Fourier Transforms, Wavelet
transforms, and grammar checking programs. I suppose that I use very
specific programs. However, for these programs, Clean is as fast as C.
And much easier to use.