From: Ong Han Ming
Subject: porting lisp->c++
Date: 
Message-ID: <6jp4a3$33s$1@blackwidow.iti.gov.sg>
I am recently put in charge of porting an NLP lisp application
to C++. Would appreciating it if any one of you could point
me to 

   - a book
   - a website
   - a software 

   on this particular topic

thanks much,
-- 
Han Ming

From: Fred Gilham
Subject: Re: porting lisp->c++
Date: 
Message-ID: <u7g1i7d3j3.fsf@snapdragon.csl.sri.com>
·······@iti.gov.sg (Ong Han Ming) writes:

> I am recently put in charge of porting an NLP lisp application
> to C++. Would appreciating it if any one of you could point
> me to 
> 
>    - a book
>    - a website
>    - a software 
> 
>    on this particular topic
> 

Hmn, this makes me wonder.  If lisp is good for `rapid prototyping'
then there ought to be some experiences of people doing this.  I know
there are some lisp-to-C translators but it seems to me that this
person has some management-driven or market-driven mandate and is just
doing what he has been told to do, so he really needs C++.

I have the impression that porting lisp programs that make significant
use of advanced lisp features to C++ would be difficult, but maybe
someone else knows better?


-- 
Fred Gilham                                       gilham @ csl . sri . com
King Christ, this world is all aleak, / And life preservers there are none,
And waves that only He may walk / Who dared to call Himself a man.
-- e. e. cummings, from Jehovah Buried, Satan Dead
From: William Paul Vrotney
Subject: Re: porting lisp->c++
Date: 
Message-ID: <vrotneyEt7A43.Axx@netcom.com>
In article <··············@snapdragon.csl.sri.com> Fred Gilham
<······@snapdragon.csl.sri.com> writes:

> 
> ·······@iti.gov.sg (Ong Han Ming) writes:
> 
> > I am recently put in charge of porting an NLP lisp application
> > to C++. Would appreciating it if any one of you could point
> > me to 
> > 
> >    - a book
> >    - a website
> >    - a software 
> > 
> >    on this particular topic
> > 
> 
> Hmn, this makes me wonder.  If lisp is good for `rapid prototyping'
> then there ought to be some experiences of people doing this.  I know
> there are some lisp-to-C translators but it seems to me that this
> person has some management-driven or market-driven mandate and is just
> doing what he has been told to do, so he really needs C++.
> 
> I have the impression that porting lisp programs that make significant
> use of advanced lisp features to C++ would be difficult, but maybe
> someone else knows better?
> 

There's nothing like Common Lisp itself, but a few years ago out of shear
frustration using C++ virtual functions and existing C++ libraries for
porting Lisp apps I wrote a C++ library called Lpp (Lisp Plus Plus) with
exactly this in mind.

A few things that Lpp can do: It has the basic semantics of Common Lisp and
uses the Common Lisp naming conventions for function names.  Different from
other similar kinds of C++ libraries it goes the all the way, ie.  it uses
full dynamic typing and yet is still "type safe", has first class function
objects, mapping functions, real lisp symbols, hash tables, and uses Meta
type class objects that have the ability to dispatch in a way similar to C++
virtual functions but does not use C++ virtual functions.  Lpp types can be
mixed with ordinary C++ class members with no restrictions.  Also all Lpp
function names are defined as friends of Lpp types so that one can type

        car(cons(a, b))

instead of

        (a->cons(b))->car();

One can also do things like

        let two = S(two); // The true Lisp symbol 'two
        let list1 = list(C(1), two, C("three"), myobject));
        print(list1);
        cout << "list1 = " << list1 << endl;
        dolist(x, list1) cout << x << endl;
        let s_expression = read(s) // read CL S-expressions from C++ stream s

Only word of caution, Lpp works great, is hardened, fast, small and safe but
it is "C++ politically incorrect". :-)

I haven't absolutely completed Lpp yet but it has enough that its been used
successfully on a few serious medium sized AI projects.  Lpp is free and I
could upload it with User Manual somewhere (need a site) if anyone is
interested in playing with it.

-- 

William P. Vrotney - ·······@netcom.com
From: Reini Urban
Subject: Re: porting lisp->c++
Date: 
Message-ID: <356DEBD6.5E070858@sbox.tu-graz.ac.at>
William Paul Vrotney wrote:
> There's nothing like Common Lisp itself, but a few years ago out of shear
> frustration using C++ virtual functions and existing C++ libraries for
> porting Lisp apps I wrote a C++ library called Lpp (Lisp Plus Plus) with
> exactly this in mind.

really funny because i'm using a Lisp called Lisp++ or Lpp (say "Lisp
Plus Plus")
which is a Lisp written in C++ hence the name.

> I haven't absolutely completed Lpp yet but it has enough that its been used
> successfully on a few serious medium sized AI projects.  Lpp is free and I
> could upload it with User Manual somewhere (need a site) if anyone is
> interested in playing with it.

I and probably some AutoCAD C++ programmers would be interested because
they 
have to port a lot of old AutoLISP code to C++.

There's also a similiar free lisp-in-c++ library called Lily
 
http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/impl/lily/0.html
but this is quite slow and old. at least it uses the same semantics as
your lpp.

--
Reini Urban   http://xarch.tu-graz.ac.at/~rurban/
From: William Paul Vrotney
Subject: Re: porting lisp->c++
Date: 
Message-ID: <vrotneyEtp2pH.KBM@netcom.com>
In article <·················@sbox.tu-graz.ac.at> Reini Urban <······@sbox.tu-graz.ac.at> writes:

> 
> William Paul Vrotney wrote:
> > There's nothing like Common Lisp itself, but a few years ago out of shear
> > frustration using C++ virtual functions and existing C++ libraries for
> > porting Lisp apps I wrote a C++ library called Lpp (Lisp Plus Plus) with
> > exactly this in mind.
> 
> really funny because i'm using a Lisp called Lisp++ or Lpp (say "Lisp
> Plus Plus")
> which is a Lisp written in C++ hence the name.
> 

Interesting.  Does Lisp++ have a Lisp interpreter and compiler?  Lpp does
not, it uses the C++ compiler to generate code.


> > I haven't absolutely completed Lpp yet but it has enough that its been used
> > successfully on a few serious medium sized AI projects.  Lpp is free and I
> > could upload it with User Manual somewhere (need a site) if anyone is
> > interested in playing with it.
> 
> I and probably some AutoCAD C++ programmers would be interested because
> they 
> have to port a lot of old AutoLISP code to C++.
> 
> There's also a similiar free lisp-in-c++ library called Lily
>  
> http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/impl/lily/0.html
> but this is quite slow and old. at least it uses the same semantics as
> your lpp.
> 

Actually Lily does not have the same semantics as Lpp if it is the same one
that I remembered.  The one that I remember does things more in the spirit
of C++.  For example there is no dynamic type handling.  Lpp is the closest
to Lisp semantics than any C++ "library" that I know of.  As I stated in my
post, Lpp is (intentionally) politically incorrect C++-wise.

-- 

William P. Vrotney - ·······@netcom.com
From: David B. Lamkins
Subject: Re: porting lisp->c++
Date: 
Message-ID: <dlamkins-1805980843270001@192.168.0.1>
In article <············@blackwidow.iti.gov.sg>, ·······@iti.gov.sg (Ong
Han Ming) wrote:

>I am recently put in charge of porting an NLP lisp application
>to C++. Would appreciating it if any one of you could point
>me to 
>
>   - a book
>   - a website
>   - a software 
>
>   on this particular topic
>
>thanks much,

I'm not familiar with any literature on that particular topic.  

However, the book "Artificial Intelligence: Theory and Practice" (Dean,
Allen & Aloimonos, 1995, Benjamin/Cummings, ISBN 0-8053-2547-6) has online
source code available in both Common Lisp and C++.  (You'll find a link to
the code on <http://yoda.cis.temple.edu:8080/UGAIWWW/books/index.html> --
I've given you this rather than the target reference because you may find
something else of use in the collected links.)  

Despite the presence of additional functionality in the Lisp sources, the
C++ code contains something like 6 to 7 times more lines of code.  You may
want to keep this factor in mind when you're estimating your workload.

-- 
David B. Lamkins <http://www.teleport.com/~dlamkins/>
From: Tomas Vasko
Subject: Re: porting lisp->c++
Date: 
Message-ID: <895671939.928144@sunsite>
Ong Han Ming <·······@iti.gov.sg> wrote:
> I am recently put in charge of porting an NLP lisp application
> to C++. Would appreciating it if any one of you could point
> me to 

>    - a book
>    - a website
>    - a software 

>    on this particular topic

i am just developing software (slisp) using  witch you could do something like
this. it could be an interface between lisp and c++ programs. 
it is not done yet, i have too much work to do it now, but during vacations...
i think in august-september it will be full-functionall.

you can chceck it at: http://redbull.dcs.fmph.uniba.sk/~vasko/slisp/

					tomas
From: Howard R. Stearns
Subject: Re: porting lisp->c++
Date: 
Message-ID: <3562F19F.41BF@elwood.com>
I know of two commercial implementations that might help:

1. ILOG (France) has a product that generates C++ from "Lisp".  I
believe that it uses a proprietary Lisp dialect based on Eulisp, ISLisp,
etc.

2. Eclipse (http://www.elwood.com/eclipse-info), which my company makes,
generates HUMAN READABLE C from Common Lisp.  It supports full ANSI
Common Lisp, plus the complete MetaObject Protocol (CLOS MOP).  The
output is simultaneously compatible with BOTH K&R (traditional) AND
ANSI/ISO (standard) C compilers.  While Eclipse does not generate C++
code, it does not use the C++-prohibited parts of standard C, it does
generate prototypes, and it does automatically name mangle C++ reserved
words in addition to those defined in standard C.

Eclipse does NOT generate C++ classes, templates, etc., and we do not
have any immediate plans to do so.  However, we are considering making
the compiler open to the point where you can control what gets
generated.  For example, using the MOP, you can make your CLOS classes
be some user-defined C++-CLASS instead of STANDARD-CLASS, and then tell
the compiler what you want generated for DEFCLASS when it defines a
C++-CLASS.  

How much is it worth to you to generate idomatic C++ code instead of C?  

Ong Han Ming wrote:
> 
> I am recently put in charge of porting an NLP lisp application
> to C++. Would appreciating it if any one of you could point
> me to
> 
>    - a book
>    - a website
>    - a software
> 
>    on this particular topic
> 
> thanks much,
> --
> Han Ming
From: Howard R. Stearns
Subject: Re: porting lisp->c++
Date: 
Message-ID: <3562F211.5473@elwood.com>
I know of two commercial implementations that might help:

1. ILOG (France) has a product that generates C++ from "Lisp".  I
believe that it uses a proprietary Lisp dialect based on Eulisp, ISLisp,
etc.

2. Eclipse (http://www.elwood.com/eclipse-info), which my company makes,
generates HUMAN READABLE C from Common Lisp.  It supports full ANSI
Common Lisp, plus the complete MetaObject Protocol (CLOS MOP).  The
output is simultaneously compatible with BOTH K&R (traditional) AND
ANSI/ISO (standard) C compilers.  While Eclipse does not generate C++
code, it does not use the C++-prohibited parts of standard C, it does
generate prototypes, and it does automatically name mangle C++ reserved
words in addition to those defined in standard C.

Eclipse does NOT generate C++ classes, templates, etc., and we do not
have any immediate plans to do so.  However, we are considering making
the compiler open to the point where you can control what gets
generated.  For example, using the MOP, you can make your CLOS classes
be some user-defined C++-CLASS instead of STANDARD-CLASS, and then tell
the compiler what you want generated for DEFCLASS when it defines a
C++-CLASS.  

How much is it worth to you to generate idomatic C++ code instead of C?

Also, from your message, it is not clear what your Lisp background is. 
As always, see the web site of the Association of Lisp Users (currently
at http://www.elwood.com/alu) for general information about Lisp,
including books, tutorials, etc.  

Ong Han Ming wrote:
> 
> I am recently put in charge of porting an NLP lisp application
> to C++. Would appreciating it if any one of you could point
> me to
> 
>    - a book
>    - a website
>    - a software
> 
>    on this particular topic
> 
> thanks much,
> --
> Han Ming