From: J.D. Hollis
Subject: integrating common lisp code with c++ code
Date: 
Message-ID: <a703ja$ep2$1@news-int.gatech.edu>
how does one go about creating a system with parts written in c++ and parts
written in common lisp?  specifically, I'd like to access data and function
written in c++ from a common lisp program.  is this dependant on the
environment you're using, or is there a standard way to do this?

cheers,
j.d.

From: Rahul Jain
Subject: Re: integrating common lisp code with c++ code
Date: 
Message-ID: <871yekuqrg.fsf@photino.sid.rice.edu>
"J.D. Hollis" <········@resnet.gatech.edu> writes:

> how does one go about creating a system with parts written in c++ and parts
> written in common lisp?  specifically, I'd like to access data and function
> written in c++ from a common lisp program.  is this dependant on the
> environment you're using, or is there a standard way to do this?

If you go for FFI, there is a "standard" FFI library (actually a
ported wrapper around the existing implementations' FFI
implementations) at http://uffi.med-info.com

Currently, it's only ported to ACL, LW, and CMUCL.

Note that C++ functions are not accessible in the same way that C
functions are. You'll have to write a C wrapper first if you expect to
practically get any FFI access to C++ code.

Failing that, you might want to try CORBA, which, although a bad match
for CLOS, will work for calling C++ code. See
<http://ww.telent.net/cliki/CORBA> for more on that and links to free
CORBA implementations. The commercial implementations probably come
with CORBA support.

-- 
-> -/                        - Rahul Jain -                        \- <-
-> -\  http://linux.rice.edu/~rahul -=-  ············@techie.com   /- <-
-> -/ "Structure is nothing if it is all you got. Skeletons spook  \- <-
-> -\  people if [they] try to walk around on their own. I really  /- <-
-> -/  wonder why XML does not." -- Erik Naggum, comp.lang.lisp    \- <-
|--|--------|--------------|----|-------------|------|---------|-----|-|
   (c)1996-2002, All rights reserved. Disclaimer available upon request.
From: Fernando Rodr�guez
Subject: Re: integrating common lisp code with c++ code
Date: 
Message-ID: <kr579uoiqt35fites835itqnu3sdnq08tp@4ax.com>
On Sat, 16 Mar 2002 13:40:06 -0500, "J.D. Hollis" <········@resnet.gatech.edu>
wrote:

>how does one go about creating a system with parts written in c++ and parts
>written in common lisp?  specifically, I'd like to access data and function
>written in c++ from a common lisp program.  is this dependant on the
>environment you're using, or is there a standard way to do this?

You can easily access your c++ code via C functions. Those functions can be
called using FFI (foreign function interface). This part is implementation
dependant, so you'll have to check your manuals.

So, wrap your c++ code in a dll and call it from lisp with FFI. Other options
such as using com, corba or even worse, soap, probably aren't worth it.



----
Fernando Rodr�guez
frr at wanadoo dot es
-------
From: Tim Bradshaw
Subject: Re: integrating common lisp code with c++ code
Date: 
Message-ID: <ey3lmcsdt2g.fsf@cley.com>
* J D Hollis wrote:
> how does one go about creating a system with parts written in c++ and parts
> written in common lisp?  specifically, I'd like to access data and function
> written in c++ from a common lisp program.  is this dependant on the
> environment you're using, or is there a standard way to do this?

You can use the implementation's FFI interface: all of the
implementations I've used seriously have pretty good ones, although
they are not standardised.  Typically it's fairly painless to do this.

Or you can use CORBA, which does have a standard Lisp mapping, but is
so forbiddingly overcomplex that you will die before you understand it
(almost everyone who writes corba programs does not understand what
they are doing, I think).

--tim