This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: on the topic of GC.



> can someone with first hand experience dealing with precise GC from C
> (i.e. Emacs, Elk etc.) tell me what exactly was the painful and
> error-prone part?  in particular, was the need to register your
> references with the GC painful in itself?

The problem was that people would always make mistakes in registering
references.  They'd forget.  Or they'd leave out a registration
because they knew GC "won't happen while this inner loop runs", but
then someone else would add a hook somewhere, and suddenly GC would
happen when it wasn't expected.

Remembering to register all your references isn't that hard.  But when
you screw up, the bug can take hours to track down.  It may not show
up for months.  Basically, imagine that every local variable is a
potential heap corruption bug.  :)

Everyone always thinks, "Oh, *I* won't make that mistake."  Well,
after watching Stallman and myself make them over and over again,
month after month, I gave up on that idea pretty quick.

Short of true compiler support (which is subtle, but I think they've
figured out how to do it right recently), conservative GC is really
the way to go.  Compared to the Emacs way, it's a godsend.

And I think Guile takes the best possible approach --- only stacks are
scanned conservatively, and everything else is marked precisely.
There are one or two details which could be improved, to make it even
less likely that the compiler will hide pointers from us, but
generally, I think Guile's approach is almost at a local optimum of
engineering (the Aubrey Jaffer Legacy).

> 'cause I had a wild idea about a C-side GC interface where the
> registration is mandatory but unregistration is optional.

That would eliminate one source of problems, but not the worst one.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]