> I wonder if someone could tell me more about the speed and size of
> compiled Haskell code.  E.g. if one uses GHC to compile Haskell code
> into native code what speed performance can be expected versus a same
> program written in C (Hints about the nhc compiler are welcome).

Without going into the question of comparing Haskell performance with C
performance, we can do a rough comparison of speed and space between
the code produced by different Haskell compilers.  GHC and HBC tend to
produce code that is, broadly speaking, equally fast, with nhc98
trailing an order of magnitude behind.  GHC builds the largest code,
with HBC second, and nhc98 by far the smallest by an order of magnitude
again.

I haven't got any test figures for HBC, but comparing other Haskell
systems for some example programs, executable code sizes are as
follows:

                GHC     nhc98
calendars        190k     81k
infer            318k     89k
bspt             480k    127k
nhccomp         8113k    861k

Sample runtimes are (in seconds):

                GHC     nhc98   Hugs
calendars        0.1     1.0      7.3
infer            1.7    18.6     35.5
bspt             2.4    10.9     70.8
prolog           3.5    40.8    112.8

These obviously give just a rough guide.  Most of these figures are
taken from:

  "Compiling lazy functional programs for the Java Virtual Machine",
  David Wakeling, Journal of Functional Programming 9(6), Nov 1999.

By the way, I recommend this paper if you want to see how Haskell code
compares with hand-written Java code, as well as machine-generated Java
code.  Interesting stuff.

Regards,
    Malcolm

Reply via email to