From: Dmitri Gorbatovsky
Subject: call lisp from C/C++
Date: 
Message-ID: <g3qcmb$79l$1@aioe.org>
Hello ,

I am try to introduce lisp to the company's infrastructure, which is
(National Instruments, Visual Studio)  C/C++ on Windows. 
In order to do so , I would like to call lisp from C/C++ program.
The only way I know so far is to compile DLL from lisp code. 

Is there any possibility to call lisp from C/C++ dynamically. I mean without
DLL recompilation after change in lisp side.

Please advise.

Dmitry

From: Marco Antoniotti
Subject: Re: call lisp from C/C++
Date: 
Message-ID: <2779c39c-857d-4f7a-8e2d-4b6accc94cf5@l42g2000hsc.googlegroups.com>
On Jun 24, 10:53 am, Dmitri Gorbatovsky <····@midasitech.com> wrote:
> Hello ,
>
> I am try to introduce lisp to the company's infrastructure, which is
> (National Instruments, Visual Studio)  C/C++ on Windows.
> In order to do so , I would like to call lisp from C/C++ program.
> The only way I know so far is to compile DLL from lisp code.
>
> Is there any possibility to call lisp from C/C++ dynamically. I mean without
> DLL recompilation after change in lisp side.
>
> Please advise.
>
> Dmitry

You should have a look at ECLS http://ecls.sourceforge.net/.  The
commercial implementations have more ways of doing that.  YMMV.

Cheers
--
Marco
From: George Neuner
Subject: Re: call lisp from C/C++
Date: 
Message-ID: <h0q264p2cu2pj3l5605pcnqi15dvi762js@4ax.com>
On Tue, 24 Jun 2008 11:53:13 +0300, Dmitri Gorbatovsky
<··@midasitech.com> wrote:

>Hello ,
>
>I am try to introduce lisp to the company's infrastructure, which is
>(National Instruments, Visual Studio)  C/C++ on Windows. 
>In order to do so , I would like to call lisp from C/C++ program.
>The only way I know so far is to compile DLL from lisp code. 
>
>Is there any possibility to call lisp from C/C++ dynamically. I mean without
>DLL recompilation after change in lisp side.
>
>Please advise.

You can use any IPC mechanism your Lisp supports.  As long as the
C/C++ visible interface doesn't change, you should be able to use the
new Lisp code immediately.

George
--
for email reply remove "/" from address
From: Dmitri Gorbatovsky
Subject: Re: call lisp from C/C++
Date: 
Message-ID: <g3t9eb$kfa$2@aioe.org>
George Neuner wrote:
> You can use any IPC mechanism your Lisp supports.  As long as the
> C/C++ visible interface doesn't change, you should be able to use the
> new Lisp code immediately.
> 
> George
> --
> for email reply remove "/" from address

Maybe I should clarify myself.
Or maybe I am asking something so obvious, that any one should know that.
Please advise me . How can I call lisp from C/C++ program
on Windows, send to it pointer on "something" , change that "something" in
lisp,  and "return" back to C/C++ program.

Thanks, Dmitry
From: George Neuner
Subject: Re: call lisp from C/C++
Date: 
Message-ID: <q86564dngafi3c4ra1crae61a7hgluf318@4ax.com>
On Wed, 25 Jun 2008 14:16:41 +0300, Dmitri Gorbatovsky
<··@midasitech.com> wrote:

>George Neuner wrote:
>> You can use any IPC mechanism your Lisp supports.  As long as the
>> C/C++ visible interface doesn't change, you should be able to use the
>> new Lisp code immediately.
>> 
>Maybe I should clarify myself.
>Or maybe I am asking something so obvious, that any one should know that.
>Please advise me . How can I call lisp from C/C++ program
>on Windows, send to it pointer on "something" , change that "something" in
>lisp,  and "return" back to C/C++ program.

You didn't say you wanted to pass pointers and you did ask how to call
the Lisp without "recompiling a DLL" after every change.

One way is to embed Lisp in your C/C++ program - on Windows Corman is
an excellent choice although it's not quite standard compliant.  ECL
or ECLS are also good choices.

The other way is to run Lisp in a separate process and use an IPC
mechanism that supports passing pointers, such as COM or Corba.  Again
Corman is a good choice - it is implemented as a COM object.

George  
--
for email reply remove "/" from address
From: Dmitri Gorbatovsky
Subject: Re: call lisp from C/C++
Date: 
Message-ID: <g3vi7i$ot6$1@aioe.org>
George Neuner wrote:

> On Wed, 25 Jun 2008 14:16:41 +0300, Dmitri Gorbatovsky
> <··@midasitech.com> wrote:
> 
>>George Neuner wrote:
>>> You can use any IPC mechanism your Lisp supports.  As long as the
>>> C/C++ visible interface doesn't change, you should be able to use the
>>> new Lisp code immediately.
>>> 
>>Maybe I should clarify myself.
>>Or maybe I am asking something so obvious, that any one should know that.
>>Please advise me . How can I call lisp from C/C++ program
>>on Windows, send to it pointer on "something" , change that "something" in
>>lisp,  and "return" back to C/C++ program.
> 
> You didn't say you wanted to pass pointers and you did ask how to call
> the Lisp without "recompiling a DLL" after every change.
> 
> One way is to embed Lisp in your C/C++ program - on Windows Corman is
> an excellent choice although it's not quite standard compliant.  ECL
> or ECLS are also good choices.
> 
> The other way is to run Lisp in a separate process and use an IPC
> mechanism that supports passing pointers, such as COM or Corba.  Again
> Corman is a good choice - it is implemented as a COM object.
> 
> George
> --
> for email reply remove "/" from address

Yes , that exactly what I want - call lisp function without compiling and
recompiling them to .DLL and be able to pass C/C++ pointers as
an arguments to lisp functions. 

Till now I am not succeed to connect to Corman's  COM interface,
actually I can't even find it.

Thanks, Dmitry
From: George Neuner
Subject: Re: call lisp from C/C++
Date: 
Message-ID: <tula64ttfoq7o5taqpn3otnmgedprkfn0l@4ax.com>
On Thu, 26 Jun 2008 10:58:57 +0300, Dmitri Gorbatovsky
<··@midasitech.com> wrote:

>George Neuner wrote:
>
>> On Wed, 25 Jun 2008 14:16:41 +0300, Dmitri Gorbatovsky
>> <··@midasitech.com> wrote:
>> 
>>>George Neuner wrote:
>>>> You can use any IPC mechanism your Lisp supports.  As long as the
>>>> C/C++ visible interface doesn't change, you should be able to use the
>>>> new Lisp code immediately.
>>>> 
>>>Maybe I should clarify myself.
>>>Or maybe I am asking something so obvious, that any one should know that.
>>>Please advise me . How can I call lisp from C/C++ program
>>>on Windows, send to it pointer on "something" , change that "something" in
>>>lisp,  and "return" back to C/C++ program.
>> 
>> You didn't say you wanted to pass pointers and you did ask how to call
>> the Lisp without "recompiling a DLL" after every change.
>> 
>> One way is to embed Lisp in your C/C++ program - on Windows Corman is
>> an excellent choice although it's not quite standard compliant.  ECL
>> or ECLS are also good choices.
>> 
>> The other way is to run Lisp in a separate process and use an IPC
>> mechanism that supports passing pointers, such as COM or Corba.  Again
>> Corman is a good choice - it is implemented as a COM object.
>> 
>> George
>> --
>> for email reply remove "/" from address
>
>Yes , that exactly what I want - call lisp function without compiling and
>recompiling them to .DLL and be able to pass C/C++ pointers as
>an arguments to lisp functions. 
>
>Till now I am not succeed to connect to Corman's  COM interface,
>actually I can't even find it.
>
>Thanks, Dmitry

AFAIK, the COM interface isn't documented, but you can find it in the
"include" directory.  Also, if you look in the directories
"clconsole", "clconsoleapp" and "CormanLispServer", you'll find
examples of using it.

George
--
for email reply remove "/" from address
From: Dmitri Gorbatovsky
Subject: Re: call lisp from C/C++
Date: 
Message-ID: <g45nui$5at$1@aioe.org>
George Neuner wrote:
 
> AFAIK, the COM interface isn't documented, but you can find it in the
> "include" directory.  Also, if you look in the directories
> "clconsole", "clconsoleapp" and "CormanLispServer", you'll find
> examples of using it.
> 
> George
> --
> for email reply remove "/" from address
Thank you George,
It is sound like you actually have an experience with lisp integration
on windows. I will try to do my best, before asking for code snippets.

Thanks again, Dmitry
From: Pascal J. Bourguignon
Subject: Re: call lisp from C/C++
Date: 
Message-ID: <87zlp9jsen.fsf@hubble.informatimago.com>
Dmitri Gorbatovsky <··@midasitech.com> writes:

> George Neuner wrote:
>> You can use any IPC mechanism your Lisp supports.  As long as the
>> C/C++ visible interface doesn't change, you should be able to use the
>> new Lisp code immediately.
>> 
>> George
>> --
>> for email reply remove "/" from address
>
> Maybe I should clarify myself.
> Or maybe I am asking something so obvious, that any one should know that.
> Please advise me . How can I call lisp from C/C++ program
> on Windows, send to it pointer on "something" , change that "something" in
> lisp,  and "return" back to C/C++ program.

Have a look at myecl.c
http://lispuser.net/commonlisp/ecl.html

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
__Pascal Bourguignon__                     http://www.informatimago.com/
From: Dmitri Gorbatovsky
Subject: Re: call lisp from C/C++
Date: 
Message-ID: <g3u3ap$1it$1@aioe.org>
Pascal J. Bourguignon wrote:
 
> Have a look at myecl.c
> http://lispuser.net/commonlisp/ecl.html
> 
Thanks , I'll try it.

Dmitry
From: Dmitri Gorbatovsky
Subject: Re: call lisp from C/C++
Date: 
Message-ID: <g3t9d3$kfa$1@aioe.org>
Dmitri Gorbatovsky wrote:

> Hello ,
> 
> I am try to introduce lisp to the company's infrastructure, which is
> (National Instruments, Visual Studio)  C/C++ on Windows.
> In order to do so , I would like to call lisp from C/C++ program.
> The only way I know so far is to compile DLL from lisp code.
> 
> Is there any possibility to call lisp from C/C++ dynamically. I mean
> without DLL recompilation after change in lisp side.
> 
> Please advise.
> 
> Dmitry
Maybe I should clarify myself.
Or maybe I am asking something so obvious, that any one should know that.
Please advise me . How can I call lisp from C/C++ program
on Windows, send to it pointer on "something" , change that "something" in
lisp,  and "return" back to C/C++ program.

Thanks, Dmitry
From: Pascal J. Bourguignon
Subject: Re: call lisp from C/C++
Date: 
Message-ID: <7c3an1n1lw.fsf@pbourguignon.anevia.com>
Dmitri Gorbatovsky <··@midasitech.com> writes:
> Or maybe I am asking something so obvious, that any one should know that.
> Please advise me . How can I call lisp from C/C++ program
> on Windows, send to it pointer on "something" , change that "something" in
> lisp,  and "return" back to C/C++ program.

The easiest would be to use ECLS, which is an Embeddable Common Lisp System.

-- 
__Pascal Bourguignon__