From: Bryan S. So
Subject: Lisp on C/C++
Date: 
Message-ID: <9209161755.AA02345@brownie.cs.wisc.edu>
I am seriously considering implementing some kind of list
processing on top of C, so that a C programmer can make use
of some limited Lisp facilities in C or C++.

e.g.
   main()
   {
      ...
      LISP list, symbol;

      ...
      setq(list, "((a b) (a c) (c d))");
      setq(symbol, "a");
      princ(assoc(list, symbol));
      ...
   }

I am open to any suggestions/opinions about what syntax,
facilities, internal representation... should it possess.
(as well as a good name :)


Bryan

From: Scott Blomquist
Subject: Re: Lisp on C/C++
Date: 
Message-ID: <SCOTT.92Sep17075845@surf.news.mitre.org>
In article <··················@brownie.cs.wisc.edu> ··@CS.WISC.EDU (Bryan S. So) writes:

   >I am seriously considering implementing some kind of list
   >processing on top of C, so that a C programmer can make use
   >of some limited Lisp facilities in C or C++.
   >
   > e.g.
   >   main()
   >   {
   >	 ...
   >	 LISP list, symbol;
   >
   >	 ...
   >	 setq(list, "((a b) (a c) (c d))");
   >	 setq(symbol, "a");
   >	 princ(assoc(list, symbol));
   >	 ...
   >      }
   >
   >   I am open to any suggestions/opinions about what syntax,
   >   facilities, internal representation... should it possess.
   >   (as well as a good name :)
   >
   >   Bryan

Bryan - 

If you're thinking of using C++...

  There are already a number of commercial and PD packages for C++ that
handle lists and other utility functions.  I don't know of any ones
that follow thef syntax that you describe above, though.  Is that
really important?  If the syntax is important, then you could probably
use one of the packages a a base for you class, instead of
implementing everything from scratch.  If you need any more help with
this follow comp.lang.c++ or mail me.  I think I can scrape up some
C++ List Libs references and/or posts.

If you're thinking of using C...

  I don't really know much about C libs, for lists etc, but there
probably some out there, if you look hard enough.  Again is syntax is
important?  Re-use a library if you can.

By the way if the syntax above is important, Why?  Writing Lisp in C++
sounds kind of confusing.  Sounds like an interesting project anyway.
:-) 

					Later...
						...Scott



--
xx---xx---xx---xx---xx---xx---xx---xx---xx---xx---xx---xx---xx---xx---xx
Scott E. Blomquist : The MITRE Corp : ·····@surf.mitre.org
                   : (617) 271-2000 : ···@mitre.org
xx---xx---xx---xx---xx---xx---xx---xx---xx---xx---xx---xx---xx---xx---xx
Disclaimer * my_disclaimer = new Disclaimer(); cout << my_disclaimer;
From: Stefan Monnier
Subject: Re: Lisp on C/C++
Date: 
Message-ID: <Mei=Qsm00awB41f1dV@andrew.cmu.edu>
Excerpts from netnews.comp.lang.lisp: 17-Sep-92 Re: Lisp on C/C++ Scott
·········@surf.new (1944)

> By the way if the syntax above is important, Why?  Writing Lisp in C++
> sounds kind of confusing.  Sounds like an interesting project anyway.
> :-) 

> 					Later...
> 						...Scott


Not only sounds it confusing: it is quite hard to implement
such functions, cause of lack of GC !!

But try it anyway, it's interesting !

	Stefan Monnier

-----------------------------------------------------
-- On the average, people seem to be acting normal --
-----------------------------------------------------
From: Rick Busdiecker
Subject: Re: Lisp on C/C++
Date: 
Message-ID: <RFB.92Sep17184743@H.cs.cmu.edu>
In article <··················@andrew.cmu.edu> Stefan Monnier <·····@andrew.cmu.edu> writes:

   Excerpts from netnews.comp.lang.lisp: 17-Sep-92 Re: Lisp on C/C++ Scott
   ·········@surf.new (1944)

   > By the way if the syntax above is important, Why?  Writing Lisp in C++
   > sounds kind of confusing.  Sounds like an interesting project anyway.

   Not only sounds it confusing: it is quite hard to implement
   such functions, cause of lack of GC !!

Actually, you can use constructors and destructors to maintain a
binding stack and do reasonable GC.  I've played around with this a
bit, but I don't have anything mature enough to distribute.

-- 
Rick Busdiecker <····@cs.cmu.edu>
``Beware of programmers carrying screwdrivers''
				- Unknown
From: ···@minster.york.ac.uk
Subject: Re: Lisp on C/C++
Date: 
Message-ID: <716784626.10954@minster.york.ac.uk>
Bryan S. So (··@CS.WISC.EDU) wrote:
: I am seriously considering implementing some kind of list
: processing on top of C, so that a C programmer can make use
: of some limited Lisp facilities in C or C++.

That is very noble idea, but I'm affraid someone did it before
you... SIOD (Scheme In One Defun) allows you access to all 
the nice Scheme/Lisp stuff from C without problems.
(well...)

dan
From: Bob Pendelton
Subject: Re: Lisp on C/C++
Date: 
Message-ID: <1992Sep18.142341.18720@hal.com>
From article <···············@minster.york.ac.uk>, by ···@minster.york.ac.uk:
> Bryan S. So (··@CS.WISC.EDU) wrote:
> : I am seriously considering implementing some kind of list
> : processing on top of C, so that a C programmer can make use
> : of some limited Lisp facilities in C or C++.
> 
> That is very noble idea, but I'm affraid someone did it before
> you... SIOD (Scheme In One Defun) allows you access to all 
> the nice Scheme/Lisp stuff from C without problems.
> (well...)
> 
> dan

That's not *quite* the same idea... Anyway if you like SIOD, check out
ELK (Extensions Language Kit). It is also a scheme interpreter written
in C that is designed to be embedded in applications.

On the original subject, it's doable, it's been done, and it's a lot
of fun. The first reference I'm aware of for this kind of work is a
thing called SLIP (Symetric LIst Processing (I think)) that was a set
of LISP like procedure calls written in an early dialect of FORTRAN.
The implementation of recursive procedure calls (FORTRAN isn't, well
at least it wasn't, recursive) was quite educational.

			Bob P.
-- 
Bob Pendleton             | As an engineer I hate to hear:
····@hal.com              |   1) You've earned an "I told you so."
Speaking only for myself. |   2) Our customers don't do that.
                   <<< Odin, after the well of Mimir. >>>
From: Bryan S. So
Subject: Re: Lisp on C/C++
Date: 
Message-ID: <1992Sep19.084418.16872@cs.wisc.edu>
In article <···············@minster.york.ac.uk> ···@minster.york.ac.uk writes:
>Bryan S. So (··@CS.WISC.EDU) wrote:
>: I am seriously considering implementing some kind of list
>: processing on top of C, so that a C programmer can make use
>: of some limited Lisp facilities in C or C++.
>
>That is very noble idea, but I'm affraid someone did it before
>you... SIOD (Scheme In One Defun) allows you access to all 
>the nice Scheme/Lisp stuff from C without problems.
>(well...)

Thanks for many people who pointed SIOD out to me. 

Yes, SIOD has some capabilities that I want.  And I
will probably build on top of it.  BUT...

the documentation for use of SIOD in C/C++ is minimal,
i.e. practically zero.  I am now reading SIOD codes
line by line.  If anybody can point out SIOD documents,
it will save me a lot of time.

Thanks.  (I got SIOD from world.std.com)


Bryan
From: Paul Miller
Subject: Re: Lisp on C/C++
Date: 
Message-ID: <5178@balrog.ctron.com>
In article <··················@brownie.cs.wisc.edu>, ··@CS.WISC.EDU (Bryan S. So) writes:
>I am seriously considering implementing some kind of list
>processing on top of C, so that a C programmer can make use
>of some limited Lisp facilities in C or C++.
>
>Bryan
 
There was an article in Dr Dobbs Journal (last year?) called "Lisp-Like extensions to C".
The magazine is at home, but I can give more info if you're interested. . .
From: [Invalid-From-Line]
Subject: Re: Lisp on C/C++
Date: 
Message-ID: <92268.134154U54294@uicvm.uic.edu>
Hi,
   The references in Dr. Dobb's are:
         An Improved Lisp-Style Library for C
            by Douglas Chubb, Dr. Dobb's #192, September 1992
         A Lisp-Style Library for C
            by Daniel Ozick, Dr. Dobb's Journal #179, August 1991

         Source is available online from various archives. Around here
         we use wuarchive.wustl.edu, something like MSDOSDDJMAG.
         Or try /pub/ddj at ftp.mv.com, or the DDJ Forum on Compuserve.

         Nick G.
From: Paul Miller
Subject: Re: Lisp on C/C++
Date: 
Message-ID: <5224@balrog.ctron.com>
In article <····@balrog.ctron.com>, ·······@adonis.ctron.com (Paul Miller) writes:
>In article <··················@brownie.cs.wisc.edu>, ··@CS.WISC.EDU (Bryan S. So) writes:
>>I am seriously considering implementing some kind of list
>>processing on top of C, so that a C programmer can make use
>>of some limited Lisp facilities in C or C++.
>>
>>Bryan
> 
>There was an article in Dr Dobbs Journal (last year?) called "Lisp-Like extensions to C".
>The magazine is at home, but I can give more info if you're interested. . .
The article was in Dr Dobb's Journal, August 1991:

"_A Lisp-Style Library for C_ Adding essential features of Lisp to C
simplifies handling of complex data objects."
by Daniel N. Ozick, pp36-48 + listings.

paul
·······@ctron.com
From: Pierre JOUVELOT <········@cri.ensmp.fr>
Subject: Re: Lisp on C/C++
Date: 
Message-ID: <PJ.92Oct8134538@linz.ensmp.fr>
In article <··················@brownie.cs.wisc.edu>, ··@CS.WISC.EDU
(Bryan S. So) writes: 

   >>I am seriously considering implementing some kind of list
   >>processing on top of C, so that a C programmer can make use
   >>of some limited Lisp facilities in C or C++.

You may be interested in looking at the tool NewGen that we developed
in-house to do something similar.  The summary of a paper describing
NewGen follows.  NewGen can be anonymously ftped from isatis.ensmp.fr
(but his still in its development stage).

Pierre

PS: We are working on extending the framework pioneered in NewGen.
    Comments would be welcome on what people think is missing there.

--

NewGen is a software engineering tool that helps programmers define and
implement sophisticated data types. Data {\em domains} are defined with
a high level specification language, called {\em DDL}, that allows user
defined domains to be built over {\em basic} domains with operators like
Cartesian product, union, list or array.

NewGen analyzes a set of specifications and produces a collection of
macros, functions, predicates, and pre-defined constants that enable
programs to create, initialize, access, update, and delete objects of
these types as if the programming language had been especially tailored
to manipulate {\em these} data types.

NewGen promotes the ideas of {\em functional abstraction} and {\em
evolution process} as ways to ease the prototyping, development and
evolution of applications that use such multi-language program
generators.  Applications that are developed with NewGen data types can
share complex data structures while being written partly in C and partly
in CommonLISP, the two currently supported programming languages.

NewGen ideas have been validated in practice; this tool is heavily used
for two projects that focus on the development of state-of-the-art
parallelization strategies for Fortran programs.