can a lazy language give fast code?

Simon Marlow simonmar@microsoft.com
Mon, 29 Jul 2002 10:23:05 +0100


> Can one write withthe Haskell compliler faster code than in=20
> the examples of http://www.bagley.org/~doug/shootout/  where=20
> GHC (old Haskell 98?) seems to be much slower than Ocaml  or=20
> Mlton both strict functional languages.
> Can one expect any improvements in speed in the future?

Many of those programs can be written differently to improve
performance.  One issue that is affecting performance in several cases
is the speed of character I/O, and the representation of Strings as
lists of characters.  Dramatic improvements can be had by using unboxed
arrays of Char (Data.Array.Unboxed), or PackedString (which these days
is implemented using unboxed arrays in GHC).

Cheers,
	Simon=20