This is the mail archive of the guile@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: gc notes available


Chris.Bitmead@misys.com.au writes:

> >As I asked before, if it's not too much to ask for the C user
> >to register each and ever write, then why do we bother with conservative
> >GC stack scanning when we can ask the user to register SCM variables
> >on the stack? If fact, if we go for SCM_ASSIGN(loc, val) then
> >we can throw out stack scanning then and there because the C user
> >is implicitly announcing the existence of a stack variable as soon
> >as he/she assigns anything to it.
> 
> I agree. Declaring the use of stack variables isn't that big a deal, and
> it gives the GC the most freedom. (I don't see why we shouldn't aim to have
> the best GC possible. I don't see that we should compromise just because
> we want to interface with C etc.). 

There are two reasons why it likely won't happen:

1) Dealing with declaring stack variables is quite a pain of tedious
   and error prone bookkeeping. Since interfacing with c is one of
   guile's strengths (it is an extension language, after all), it has
   to be fairly painless. 

   Using something like SCM_ASSIGN (if adopted, which also isn't
   terribly likely, since it requires more work for every assignment,
   when this can be more easily achieved by going through system
   functions, rather than fiddling with objects on a low level... only
   the daring or needy have to find out what the gc is doing with the
   objects) only requires a change from using =, which is not a major
   leap, though it would be somewhat tedious to change existing code.

   Smobs are a different story, but they become a bit more difficult
   in any case, and explicit registration of stack roots doesn't help
   one bit.

2) Jim Blandy has expressed that he doesn't want it in guile, and has
   had enough experience with it in emacs to know what a royal pain it
   can become. Unless he changes his mind, it won't go into guile.

Personally, I don't care one way or the other, but I don't do much c
programming with guile (outside of gc stuff, which doesn't really
count).

-- 
Greg