I am curious. How much faster do you think GHC would run if it were written
in C? Or how much slower would a C++ compiler be if it were written in
Haskell instead of C++?
It seems to me that a compiler would be an ideal candidate for writing in a
functional language. The number of times C++ compilers have given out on me
indicates that C++ is not suitable for writing anything as complicated as a
C++ compiler.
> Hello Steve,
>
> > I just want to say that Haskell is a fat old slow
> > dinosaur compared with Clean. [...]
>
> By Haskell you probably mean the Glasgow Haskell Compiler (GHC). And
> compilation by GHC is certainly slower than by the Clean compiler. On the
> other hand, the generated code is comparable, sometimes faster, sometimes
> slower. See:
>
> Benchmarking implementations of lazy functional languages II -- Two years
> later
>
http://hypatia.dcs.qmw.ac.uk/SEL-HPC/Articles/GeneratedHtml/functional.imp
> lemen.html#HartelPH1994a )
>
> In this article you can read that GHC has improved considerably since the
> first article and Clean "not significantly". If this is a trend then by
now
> (four years later) GHC's code could be always faster than Clean's. Maybe
> it's time for a new benchmark.
>
> The reason that GHC's compilation times are longer is that it is written
in
> Haskell (as opposed to C for the Clean compiler). However, during
> development many people use the Haskell interpreter Hugs. This interpreter
> is fast, interactive and light-weight. So by using both GHC and Hugs you
can
> get speed in both areas.
>
> An advantage of a compiler written in Haskell is that it is easier to
> maintain and that more people can experiment with it. The source code of
the
> Clean compiler is a secret.
>
> Another thing you mention is that Haskell is old. This remark shows that
you
> have not been paying attention to the Haskell community. Things move
rather
> fast. So fast that it has been decided to freeze Haskell at a certain
point
> (Haskell 98). But research continues on what you might call Haskell 2 or
> Haskell 2000. Some features that have been implemented lately include
> implicit arguments, extensible records and class constraints.
>
> I've used both languages a lot and I like them both. Where Clean stands
out
> in comparison to Haskell is that it has a library for making
> platform-independent GUIs. In the Haskell world there is not yet a
standard
> GUI framework. I would love to see a library with the simplicity of
TkGofer
> for Hugs and/or GHC.
>
> In Haskell I like the IO monad very much. It gives you input and output,
> exceptions and mutable variables. In combination with implicit arguments
it
> allows you to elegantly write down inherently imperative code.
>
> As a teacher I think the type systems of both languages are very complex,
> possibly too complex. Therefore, error messages are often hard to
> understand. If we want to make (more) students enthusiastic about
functional
> programming this is a problem that should be tackled in the near future.
>
> Arjan
> teacher, former member of the Clean team, Haskell enthusiast and Mondrian
> hacker
>
>
>