From: Takashi Ishihara
Subject: Q: lisp + c/c++
Date: 
Message-ID: <86okha$s8n$1@mark.ucdavis.edu>
Hi all,
I have heard that it' possible to integrate lisp code w/ c or c++.
Searching on the web did not help at all.
man clisp does not tell how to get *.c or *.o from *.lsp
i.e. Here my interest is not to call a foreign function in lisp, but
to generate *.c or binary executable so that lisp src can be integrated
into c/c++.

One of the main reason to integrate clisp code to c/c++ (preferably gcc/g++)
is that I'm too lazy to write arbitrary precision functions in c/c++.

In any case, if it's really possible to integrate lisp code to c code,
please let me know. I don't care to use other lisp variant such as scheme.
Thanks.
From: Pierre R. Mai
Subject: Re: Q: lisp + c/c++
Date: 
Message-ID: <87g0vj7k03.fsf@orion.dent.isdn.cs.tu-berlin.de>
Takashi Ishihara <······@logan.ucdavis.edu> writes:

Hi, I'll quote your article below out of order:

> One of the main reason to integrate clisp code to c/c++ (preferably gcc/g++)
> is that I'm too lazy to write arbitrary precision functions in c/c++.

If this is really your main reason, then take a look at the source
code for CLISP:  IIRC then the arbitrary precision functions of CLISP
are implemented in C (possibly with a bit of macrology thrown in), so
integrating this into a C/C++ scenario should be fairly easy.

> I have heard that it' possible to integrate lisp code w/ c or c++.
> Searching on the web did not help at all.
> man clisp does not tell how to get *.c or *.o from *.lsp
> i.e. Here my interest is not to call a foreign function in lisp, but
> to generate *.c or binary executable so that lisp src can be integrated
> into c/c++.

Since Common Lisp is much better suited for high-level programming
than C or C++,  the usual approach is indeed to integrate C/C++
libraries and object code into the Lisp core, and not vice versa.

To go the other route, you need a Common Lisp implementation that is
especially geared towards such usage:  Of the currently supported
Common Lisps, only Eclipse (see http://www.elwood.com/eclipse/) seems
to support such usage easily.  On the windows platform, you could
probably use COM to do something like this (which IIRC is supported by 
Franz' Allegro CL, Harlequin's LispWorks and Roger Corman's Corman
Lisp), but for your usage this would seem to be too much overhead.

Regs, Pierre.

-- 
Pierre Mai <····@acm.org>         PGP and GPG keys at your nearest Keyserver
  "One smaller motivation which, in part, stems from altruism is Microsoft-
   bashing." [Microsoft memo, see http://www.opensource.org/halloween1.html]