[Haskell-cafe] Write Haskell as fast as C. [Was: Re: GHC predictability]

Don Stewart dons at galois.com
Thu May 15 16:56:01 EDT 2008

> On Thu, 2008-05-15 at 11:31 -0700, Don Stewart wrote:
> > I've written an extended post on how to understand and reliably optimise
> > code like this, looking at it all the way down to the assembly.
> > 
> > The result are some simple rules to follow for generated code as good
> > as gcc -O2.
> > 
> > Enjoy,
> > 
> >     http://cgi.cse.unsw.edu.au/~dons/blog/2008/05/16#fast
> A good read. 
> Side point: Is the name "go" part of the idiom you mentioned? I
> sometimes use the same practise but usually just calls the worker the
> same as the real function with an added prime (').

I moved away from that idiom as it was too easy to call the wrapper by
accident, by leaving off a prime.

In large libraries, I sometimes add the wrapper name to the 'go', so I
can find it in the core later, e.g.

f x y = go_f 0
        go_f ..

-- Don

More information about the Haskell-Cafe mailing list