[Haskell-cafe] Re: What I learned from my first serious attempt low-level Haskell programming

Stefan O'Rear stefanor at cox.net
Tue Apr 10 18:13:34 EDT 2007


On Tue, Apr 10, 2007 at 07:59:04PM +0100, Lennart Augustsson wrote:
> So then tail calls should be very cheap when most of the arguments  
> don't change.
> 
> On Apr 10, 2007, at 10:17 , Simon Marlow wrote:
> 
> >Lennart Augustsson wrote:
> >>It's not that hard to figure out an order to permute the arguments  
> >>on the stack before a tail call that minimizes that number of  
> >>moves and temporary locations.  Lmlc did this 20 years ago. :)
> >
> >Right, and that's what GHC does too, with a strongly-connected- 
> >component analysis of the dependencies between assignments of the  
> >args for the tail call.
> >
> >Cheers,
> >	Simon

The tailcall in question is NOT statically known (it is a variant of
CPS), so simpleminded tail recursion optimizations will not help much. 

Stefan


More information about the Haskell-Cafe mailing list