Preventing/handling space leaks

ketil+haskell at ketil+haskell at
Mon Dec 8 22:39:02 EST 2003

Sven Panne <Sven.Panne at> writes:

> [ Just one more mail and I promise to shut up on this topic... :-) ]

Surely slamming C++ is on topic? :-)

> Fergus Henderson wrote:

>> [...] C does suffer from many of the same problems as C.  But in C++, it is
>> much easier to automate techniques like reference counting, which can
>> be done manually in C but are much more cumbersome and error-prone when
>> done manually.

> Granted, C++'s (copy) constructors, destructors and assignment operators make some
> things relatively easy compared to C, but the complexity of handling exceptions
> *correctly* makes things worse again: There is a famous article (I can't remember the
> title or the author) where a well-known C++ grandmaster explains a stack class,
> but another later article by someone else describes the numerous bugs in that class
> when exceptions are taken into account.

I think you're referring to this:

I'd also add that GC is more important in object oriented programming,
it's more natural to pass objects around on a larger scale.  At least
> And one final remark on Haskell and Java: In large projects in those languages you
> usually get the "genuine" space leaks in those languages plus all those nice little
> leaks from the ubiquitous native functions/methods. So you have to debug in at least
> two languages at the same time and I haven't seen combined tool support for this yet

I'm not sure I understand what you mean.  Examples?

If I haven't seen further, it is by standing in the footprints of giants

More information about the Haskell-Cafe mailing list