[Haskell] memory management

Sam Martin sam.martin at geomerics.com
Thu Aug 6 05:26:03 EDT 2009

I can see how laziness works against this, and agree it's probably not suitable for most lazy code. Generational GC does sound much more appropriate.

But fair chunks of Haskell code can be known to be strict. Either from analysis of the code, or explicit instruction by the programmer. (I also have nested data parallelism in the back of my mind for some reason.) 

I'd risk a bet that these areas of code are probably your 'inner loops' and hence areas a programmer wouldn't want allocation/deallocation to occur unless absolutely necessary. Isn't region inference an attractive option for these situations?


-----Original Message-----
From: Simon Peyton-Jones [mailto:simonpj at microsoft.com] 
Sent: 06 August 2009 08:23
To: Simon Marlow; Sam Martin
Cc: Colin Runciman; Haskell at haskell.org
Subject: RE: [Haskell] memory management

Also region inference is likely to be much less effective in a lazy language, because (I think that) data escapes the lifetime of its allocating procedure much more often.  I don't know of any work that has even tried it.


| -----Original Message-----
| From: haskell-bounces at haskell.org [mailto:haskell-bounces at haskell.org] On
| Behalf Of Simon Marlow
| Sent: 04 August 2009 14:50
| To: Sam Martin
| Cc: Colin Runciman; Haskell at haskell.org
| Subject: Re: [Haskell] memory management
| On 04/08/2009 13:33, Sam Martin wrote:
| >> Sounds like region inference to me.
| >> (https://secure.wikimedia.org/wikipedia/en/wiki/Region_inference)
| >
| > Thanks, yes, that's exactly what I had in mind.
| >
| > Is anything like this is done in GHC?
| Not at the moment, no.
| Bear in mind that with generational GC, allocating memory that quickly
| becomes garbage is quite cheap.
| Cheers,
| 	Simon
| _______________________________________________
| Haskell mailing list
| Haskell at haskell.org
| http://www.haskell.org/mailman/listinfo/haskell

More information about the Haskell mailing list