
On 03/08/2012 10:29, Joachim Breitner wrote:
Hi Simon,
Am Freitag, den 03.08.2012, 09:28 +0100 schrieb Simon Marlow:
My question is: Has anybody worked in that direction? And are there any fundamental problems with the current RTS implementation and such closures?
Long ago GHC used to have an "update analyser" which would detect some thunks that would never be re-entered and omit the update frame on them. I wrote a paper about this many years ago, and there were other people working on similar ideas, some using types (e.g. linear types) - google for "update avoidance". As I understand it you want to omit doing some updates in order to avoid space leaks, which is slightly different.
Thanks for the pointers, I will have a look. Why was the update analyser removed from GHC?
It was expensive and had very little benefit - most thunks that were deemed non-updatable by the analysis were also strict, so update analysis did very little in the presence of strictness analysis. Cheers, Simon