Subject: [clisp-list] stripping down clisp

From: "Michael Zuercher" <[email-masked]>
Date: Sun Nov 11 20:45:01 2001

I have a bunch of lisp source files that contain functions that I need to access from a C program.  However, due to memory limitations, I am not able to run a full lisp interpreter.  My current plan is to strip down Clisp to only the code needed to load a .mem file.  

Question #1:  Is there a clean way to strip Clisp down in this fashion?  I want to get rid of the whole UI and         the .fas interpreter.

Next, I will embed the stripped down version of Clisp in my C program.  I will have the FFI stuff in the .mem file so I can call the functions that I need whenever it is loaded.

Question #2:  Does this sound possible?

Since memory is VERY tight, I would like to make a .mem file with only the things I need.  I won't need many of the original functions since I will not be feeding it anything except a .mem file with everything embedded.  

Question #3: Is there a way to remove functions from the original "lispinit.mem" before dumping a new one?

Now for the really ugly part.  I don't think that I can get the full version of Clisp running on my target platform.  It is my understanding that this is necessary if I am going to create .mem file in the first place, since they are very non-portable.

Question #4: Is there a way to target a foreign platform when doing a memdump?  If not, what is the smallest chunk of Clisp that I could do the dump with?

Thanks in advance for any help you have to offer.
Michael Zuercher

---

From: Erik Arneson <[email-masked]>
Date: Sun Nov 11 22:08:02 2001

On 11 Nov 01, Michael Zuercher <[email-masked]> wrote:
> I have a bunch of lisp source files that contain functions that I
> need to access from a C program.  However, due to memory
> limitations, I am not able to run a full lisp interpreter.  My
> current plan is to strip down Clisp to only the code needed to load
> a .mem file.

Michael,

For something like this, you might be better off going with a small
Scheme implementation (perhaps Guile?), or a CL implementation that's
made to be embedded in other programs, like ECLS.

-- 
> Erik Arneson <[email-masked]>      MM, Ashland Lodge No. 23 <
> GPG Key ID: 1024D/43AD6AB8    RAM, Siskiyou Chapter No. 21 <
> <http://erik.arneson.org/>     <http://www.aarg.net/mason> <

---

From: Paolo Amoroso <[email-masked]>
Date: Mon Nov 12 11:40:04 2001

On Sun, 11 Nov 2001 22:44:29 -0600, Michael Zuercher wrote:

> I have a bunch of lisp source files that contain functions that
> I need to access from a C program.  However, due to memory
> limitations, I am not able to run a full lisp interpreter.
[...] 
> Since memory is VERY tight, I would like to make a .mem file
> with only the things I need.

You might consider using ThinLisp:

  http://thinlisp.sourceforge.net

Paolo
-- 
EncyCMUCLopedia * Extensive collection of CMU Common Lisp documentation
http://web.mclink.it/amoroso/ency/README
[http://cvs2.cons.org:8000/cmucl/doc/EncyCMUCLopedia/]