
7 Dec
2005
7 Dec
'05
9:30 a.m.
On Wed, Dec 07, 2005 at 08:21:42AM -0500, Jan-Willem Maessen wrote:
Yes, this could be done. The principle obstacles are the same as for any reference counting scheme: It imposes more run-time overhead than GC does, unless the data structures involved are large. Let me repeat that: accurate up-to-the-moment reference counting is dramatically slower than GC. Techniques exist to make ref counting fast, but they all require the equivalent of a full stack walk in order to get an accurate count.
For strict functions, does ghc do optimizations like this automatically? i.e. can it statically count references and avoid allocation of intermediates? -- David Roundy http://www.darcs.net