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: Guile: Still need to be the "Main" in "main()"???


On Tue, Jun 20, 2000 at 11:43:49AM -0700, Brent Fulgham wrote:
> Just a general question about Guile:
> 
> A fellow developer who experimented with Guile a few revisions
> ago indicated that when embedding Guile in a program as an
> extension language, you had to let Guile run as the "main"
> program, calling into the C code of the "application".  So
> the paradigm seems to be "Guile controls the main run loop, 
> calling into C periodically to handle your specific application
> functionality".

Guile runs as the "main" program, i.e. you call scm_boot_guile() from
main(), and scm_boot_guile() in turn calls another function. This other
function is what would've been main() had you not used Guile. So that part
is true. However, it is only done this way to simplify garbage collection.

> This doesn't make sense to me -- I want to control the main
> execution loop from within my C program, and periodically call
> into Guile when it suits me.

You can certainly do that, it's just a little strange in that the main
execution will start with inner_main() (or whatever you choose to call
it) instead of main() itself.

> Is this really a requirement of Guile, or was I misinformed?

It doesn't sound like you were misinformed, just that either you or your
friend is extending the garbage collector oddity into an entire paradigm.

-- 
C. Ray C. aka Christopher Cramer
crayc@pyro.net
http://www.pyro.net/~crayc/

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