Haskell vs. Clean

ana ana@ufu.br
Fri, 19 Dec 1997 23:20:37 +0000


S. Alexander Jacobson wrote:
> 
> I have recently to look more carefully into using functional programming
> in some applications.
> 
> Having browsed through the functional languages three stand out:
> Haskell, Clean, and Erlang.  The documentation I have read seems to focus
> on very theoretical aspects of these languages.
> Clean promises "lazy copying, abstract reduction and uniqueness typing",
> but I am not sure what that means in real life (and I am not sure whether
> those features have not also been adopted into e.g. Haskell or Erlang).
> I am wondering if there is any documentation comparing these
> languages/implementations in a practical programming context.
> 
> speed
> ease-of-use/rapid-prototyping
> interoperality with other systems (esp. SQL databases and CORBA)
> scalability
> robustness
> non-toy production applications developed with the system
> 
> Would you build mission critical applications with any of these systems?
> 
> Any pointers would be appreciated.
> 
> -Alex-
> 
> ___________________________________________________________________
> S. Alexander Jacobson                   Interband Communications
> 1-212-799-2645 voice                    1-212-799-1075 fax
Dear Mr Jacobson.
We have been using Clean, MLWorks, SML/NJ, Haskel and Erlang in Signal
Processing, number crunching, Natural Language Processing, and
Animation. MLWorks, SML/NJ and Erlang are very slow. If speed is what
you need, these three languages can be ruled out. People say that Haskel
is fast, but I guess that it is very difficult to write a fast program
in Haskel. One may need to insert a lot of strictness anotations to
obtain fast code from Haskel. Any way, every thing I wrote in Haskel
turned out to be so slow that I gave up. 

Clean is fast. In our home page you will find a few small programs in
Clean: a Fast Fourier Transform, a program to solve a system of linear
equations by Gaussian Elimination and a small theorem prover. We wrote
these programs in Visual C as well. Believe it or not, Clean turned out
to be faster than C!

We are also using Clean in medium size applications: Finite Elements,
Text Analysis for Greek and Latin (one of our programs regularize the
constructions used in Plato, making it easier to read passages from the
Repuplic or from Fedon. Soon you will find the result of such analysis
in our site. Of course, every thing is in Greek and can be fully
appreciated only by people who knows the dialect of Plato), a RAD for
generating Applets (we intend to put that in our site too. We have used
it to design the very compact Applets which are in our site), a system
for analysing music (soon in the net), and so on. As far as speed and
efficiency goes, we cannot file any complain againt Clean. The other
functional languages are not fast enough for the work that we are doing
here. However, MLWorks have a compiler which is simply marvelous to spot
bugs. Thus we use it to write prototypes, which are recoded in Clean
when we need a production system.

The other topics:

Ease of use - I thing Clean is easy to use. MLWorks is easier.
Rapid prototype - I would rather use MLWorks for this.
Scalability - Not observed.
Robustness - Clean code is quite robust.
Non-toy production application - Our main interest is to process books
written in ancient languages. That involves number crunching, Natural
Language processing, theorem proving, signal processing, computer
graphics etc. We do use our programs. So they could qualify as non-toy
production applications. We also have coded everything in many
languages: C, Java, MLWorks, SML/NJ, Haskel, Prolog, Scheme. The speed
of the code generated by Clean compares favorably with the C code. The
other languages are 5 to ten times slower.
Interoperality with other systems - Clean has a very poor interface with
the non-functional world. The best interface with the ouside world is
that of Visual Prolog. In Visual Prolog, you can write a project mixing
C, C++, Prolog, Pascal, etc. The VIP compiler recognizes the structures
of C in a way which is completely transparent to the programmer. I hope
to have an interface like that for Clean someday. Meanwhile, you may
take a look at how Ronny Schereur linked Clean code with a small
function written in C. By doing the samething, you may be able to
stablish a communtication between Clean and the procedural world.