[Haskell-cafe] Automatic Reference Counting

Thomas Davie tom.davie at gmail.com
Sat Jul 2 17:51:53 CEST 2011


Hi guys,

Apple recently announced a new static analysis in Clang called ARC (Automatic Reference Counting).  The idea is to provide what GC provides (zero memory management code by the programmer), but not to incur the runtime penalty of having to have the GC run.  It seems to be extremely effective in objective-C land.

I was wondering if any of the compiler gurus out there could comment on the applicability of this kind of analysis to Haskell.  Dropping the GC and hence stopping it blocking all threads and killing parallel performance seems like nirvana.

The one major problem that's still left with ARC is that it does not solve the retain cycle problem of reference counting.  Programmers must insert a "weak" keyword to break cycles in their data graphs.  Could even this analysis be automated statically?  Could we put up with a language extension that added this annotation?

I'd love to hear some comments from people more-experienced-than-I on this.

Thanks

Tom Davie


More information about the Haskell-Cafe mailing list