At 10:41 21/09/99 GMT, Marcin 'Qrczak' Kowalczyk wrote:
>...
>I have to care how fast my programs run. 
>...
>I had to write and maintain a boring program calculating lots of
>numbers from matrices, trying various permutations of rows and columns,
>joining rows and columns, generating random matrices meeting specific
>criteria, searching for ones that maximize certain formulae etc.
>...
>Maybe it's simply not possible to compile Haskell more efficiently?

It is possible to improve the efficiency of lazy functional languages on
matrices considerably. The first thing to be done is to create an efficient
representation. As far as I know, to main reason why Clean is faster with
matrices than Haskell is due to the different representation. Also in a
lazy language many optimisations can be done. We can take a look at the
things done in implementations of C (sorry), SISAL, SAC, etc.
The high level of abstraction in modern lazy functional languages posses
both opportunities and challenges to the compiler builders. We cannot
expect the compiler to cope with each situation as good as a cleaver
low-level programmer who knows what he is doing, but it should be possible
to reduce the price (in execution time) to use a language like Haskell for
matrix manipulations. A similar argument holds for C and assembly.

Pieter Koopman




Reply via email to