From: ············@gmail.com
Subject: What is the best way to integrate C++ and LISP?
Date: 
Message-ID: <1110352478.544007.36100@o13g2000cwo.googlegroups.com>
I am working on research which requires me to integrate several AI
programs written in LISP with a game written in C++.  The development
platform is Win32/Visual Studio.  I am new to LISP and have not yet
chosen a LISP compiler/interpreter but I am leaning towards CLISP.
There are no licensing restrictions but money is extremely scarce.

Should I:

  1)  Integrate the LISP interpreter with a C++ module.
  2)  Compile the LISP code and integrate the compiled code.
  3)  Run LISP as a separate process and use IPC (sockets?)
  4)  Some other option.

What software would you recommend and what tutorials/documentation is
available to get started?

Your opinions on this would be most appreciated.

Thanks,
John

From: Paolo Amoroso
Subject: Re: What is the best way to integrate C++ and LISP?
Date: 
Message-ID: <87vf813z1t.fsf@plato.moon.paoloamoroso.it>
·············@gmail.com" <············@gmail.com> writes:

> What software would you recommend and what tutorials/documentation is
> available to get started?

You may start here:

  Practical Common Lisp
  http://www.gigamonkeys.com/book/

  Successful Lisp: How to Understand and Use Common Lisp
  http://psg.com/~dlamkins/sl/cover.html


Paolo
-- 
Why Lisp? http://lisp.tech.coop/RtL%20Highlight%20Film
Recommended Common Lisp libraries/tools (see also http://clrfi.alu.org):
- ASDF/ASDF-INSTALL: system building/installation
- CL-PPCRE: regular expressions
- UFFI: Foreign Function Interface
From: Pascal Bourguignon
Subject: Re: What is the best way to integrate C++ and LISP?
Date: 
Message-ID: <87sm35oyci.fsf@thalassa.informatimago.com>
·············@gmail.com" <············@gmail.com> writes:

> I am working on research which requires me to integrate several AI
> programs written in LISP with a game written in C++.  The development
> platform is Win32/Visual Studio.  I am new to LISP and have not yet
> chosen a LISP compiler/interpreter but I am leaning towards CLISP.
> There are no licensing restrictions but money is extremely scarce.
> 
> Should I:
> 
>   1)  Integrate the LISP interpreter with a C++ module.
>   2)  Compile the LISP code and integrate the compiled code.
>   3)  Run LISP as a separate process and use IPC (sockets?)
>   4)  Some other option.
> 
> What software would you recommend and what tutorials/documentation is
> available to get started?
> 
> Your opinions on this would be most appreciated.

In clisp, you can define call-ins: lisp functions exported as C functions.
I guess you know how to call a C function from C++...

Moreover, ISTR that works on clisp has been done recently to allow it
to be compiled as a library, so you should be able to link it into
your C++ program.

Therefore, option 1) with clisp should be a valid solution.

But I'd really consider using option 3), because it allows to change
the lisp implementation more easily.

Also, with option 1) or 2), you may envisage to use ecls or gcl who
compile to native code, so it might be easier to integrate with a C++
program.


(Note that clisp is both an interpreter and a compiler (over a virtual
machine)).

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

This is a signature virus.  Add me to your signature and help me to live