[Haskell-cafe] Re: Write Haskell as fast as C. [Was: Re: GHC
predictability]
Philippa Cowderoy
flippa at flippac.org
Fri May 16 17:55:46 EDT 2008
On Fri, 16 May 2008, Andrew Coppin wrote:
> Obviously most people would prefer to write declarative code and feel secure
> that the compiler is going to produce something efficient.
>
Ultimately the only way to do this is to stick to Einstein's advice - make
things as simple as possible but no simpler. This means that if you care
about speed then somewhere, the structure that enables a fast
implementation needs to be declared so that the compiler can work with it.
For example, you might not want to hand-fuse (I know I get bored of it
pretty quickly) but the possibility of fusion will have to be clear.
If you don't want to have to do it yourself (or don't know how!) and you
want to be confident that something's going to run fast, that means a
library covering a range of known cases that'll all go quickly. Don has
been a major contributor here! But it's hard work, and if you don't
understand how fast code is structured then ultimately you won't be able
to predict - there'll never be a guarantee that lets you be completely
ignorant.
--
flippa at flippac.org
'In Ankh-Morpork even the shit have a street to itself...
Truly this is a land of opportunity.' - Detritus, Men at Arms
More information about the Haskell-Cafe
mailing list