[Haskell-cafe] Re: OCaml list sees abysmalLanguage Shootoutresults

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Fri Oct 8 14:14:25 EDT 2004


MR K P SCHUPKE <k.schupke at imperial.ac.uk> writes:

> This sounds like the best idea to me... with each list cell being a
> full buffer you could effectively write nieve [Char] code and have it
> implemented in about as fast a way as possible...

If the representation of some lists was changed, it would complicate
all code which works on lists. Or maybe only polymorphic code, but
it's still much. I don't believe it would be practical.

In general only specific *code* can be compiled more efficiently.
Data can't have special cases represented differently without inducing
a cost to some other code which doesn't know statically whether the
special case is used and must deal with the complexity at runtime.

It can't be transparent. A different type for semi-packed strings,
with some tricky implementation - fine. But without making good old
lists harder.

OCaml represents arrays of floats differently than others. It makes
all the generic array code much slower than it would be without
that decision, and slower than the same code copied-and-pasted but
specialized to some concrete type. IMHO it was a bad decision
(but I don't have any concrete benchmark data to confirm this).
It would be better to have a separate float array type. Of course
it would be problematic to have a convenient syntax for them, as
OCaml doesn't like overloading...

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


More information about the Haskell-Cafe mailing list