Simon Peyton-Jones wrote:
...
There is an efficiency cost though. Each IORef would need to have an
extra field, to record its allocation ID. (Address is not enough -- the
garbage collector can mangle them.)


My own view is that this is fine -- IORefs shouldn't be in your inner
loop, so an extra word in each is no big deal.   Unless there are views
to the contrary, I'd be happy to see this in GHC.

It's worth noting at this point that the Java world has developed a nice, big bag of tricks for language implementors to use to solve exactly this problem. Somehow, they make it work even for the stuff which *is* in the inner loop. :-)


-Jan

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to