Subject: Re: Implementing Lisp in C?
From: (Rob Warnock)
Date: Sun, 11 Apr 2004 07:18:34 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Duane Rettig  <> wrote:
| (Rob Warnock) writes:
| > Somebody posted some code here just recently to do *exactly* that...
| > From: Eric Marsden <>
| > <>
| > The function RELOAD-SHARED-LIBRARIES, which he cheerfully admits is
| > CMUCL-specific and nowhere near "supported".
| This looks correct, but there's still a piece missing (though CMUCL might
| already do this anyway): When a user does a
| dumplisp/save-image/whatever-it's-called-by-your-vendor the reborn
| lisp image should for the most part come back up the way it had been
| before.  So all those loaded .so files should also be re-loaded if
| they exist...

No, CMUCL doesn't try to do this for you. In fact, there's a warning
in the CMUCL User's Manual in the section on the "Alien" FFI stuff:

    8.6 Loading Unix Object Files
    Foreign object files are loaded into the running Lisp process
    by LOAD-FOREIGN...
    Note that if a Lisp core image is saved (using SAVE-LISP),
    all loaded foreign code is lost when the image is restarted.

[The same is equally true if you use the internal SYSTEM::LOAD-OBJECT-FILE
to load ".so" files directly, as some of us do...]

That said, though, CMUCL *does* provide an *AFTER-SAVE-INITIALIZATIONS*
hook -- "a list of functions which are called when a saved core image
starts up" -- so before saving the image you can push a closure onto
this hook to (re)load stuff for you.

| (this part is a stickler, since the dumped image might be moved
| to a different directory or even to a different machine, but it
| is resolvable, especially by using logical pathnames).

That helps, but varying versions of operating systems and/or system
libraries might create further portability problems, just as they do
with C programs that use shared libs.

| For Allegro CL, we have a FAQ entry, with the question "How does Lisp
| start up, in terms of shared-library linking and loading?" which is at
| Note specifically bullet 9 in the section labelled "The Startup Process".

Interesting, thanks!


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607