I have a LISP program and a C program running on a UNIX box (IBM RS6000
and an IBM PowerPC 250). I need to send data back and forth between
the two. Are there any commercially available or public domain
products that set up the communications between these very different
programming environments?
(FYI - I am a C programmer and a UNIX systems programmer, but not a LISP
programmer, so I will understand techno-weenie speak about C or UNIX,
but will need more basic descriptions for things on the LISP side.)
-Bev
-----------------------------
--
Bev Schwartz BBN Corporation
········@bbn.com 70 Fawcett St, MS 15/1C
617-873-2453 Cambridge, MA 02138
It depends on the lisp you're using. In Lucid or Franz Allegro, this
is rather easy. The easiest way is to tell lisp to run a local or
remote shell program and communicate via stdin/stdout on the C side
and stream input/ouptut on the lisp side. You can get more exotic if
you want to use socket-based ipc.
-- Nicolas.
--
Nicolas Rouquette Artificial Intelligence Group
Email: ········@aig.jpl.nasa.gov Jet Propulsion Laboratory, M/S 525-3960
Phone: (818) 306-6916 4800 Oak Grove Dr.
Fax: (818) 306-6912 Pasadena, CA 91109
In article <··········@overcat.jpl.nasa.gov> ········@overcat.jpl.nasa.gov (Nicolas Rouquette) writes:
It depends on the lisp you're using. In Lucid or Franz Allegro, this
is rather easy. The easiest way is to tell lisp to run a local or
remote shell program and communicate via stdin/stdout on the C side
and stream input/ouptut on the lisp side. You can get more exotic if
you want to use socket-based ipc.
Some implementations (at least Harlequin LispWorks, I know) support
TCP streams. These are very often the most convenient, reasonably
efficient form of communication between C/C++ and Common Lisp
programs.
--
Lawrence G. Mayka
AT&T Bell Laboratories
···@ieain.att.com
Standard disclaimer.
lgm> Some implementations (at least Harlequin LispWorks, I know)
lgm> support TCP streams.
All Lisps that have CLX probably support TCP streams in some way,
because CLX uses TCP streams to communicate with X servers (ok, it
could also use DECnet streams...).
lgm> These are very often the most convenient, reasonably efficient
lgm> form of communication between C/C++ and Common Lisp programs.
Unfortunately yes. If would certainly be nice if there were Lisp
interfaces to (somewhat) higher-level distributed programming methods
such as RPC (or PVM, or CORBA).
--
Simon.
In article <··········@info-server.bbn.com> ········@bbn.com (Bev Schwartz) writes:
I have a LISP program and a C program running on a UNIX box (IBM RS6000
and an IBM PowerPC 250). I need to send data back and forth between
the two. Are there any commercially available or public domain
products that set up the communications between these very different
programming environments?
(FYI - I am a C programmer and a UNIX systems programmer, but not a LISP
programmer, so I will understand techno-weenie speak about C or UNIX,
but will need more basic descriptions for things on the LISP side.)
I don't know whether there are commercial products to address this,
however at a previous position, I implemented a pretty straight
forward solution that might work for you if your bandwidth isn't too
high and you can do TCP/IP on your PowerPC. In our system, we had a C
program interacting with several other processes using sockets with a
select/dispatch loop. One of the processes was a lisp system. The
lisp interaction was extremely limited -- calling a single function
that took a string as an argument and returned an integer. It was
accomplished by having a C program set up a pseudo-terminal, fork,
exec the lisp in the child, and drive the read-eval-print loop from
the parent using the pseudo-terminal.
It was packaged up so that from C you would call a function that
accepted a string and a call-back function. The call-back accepted an
integer. In addition, there was a synchronous version that accepted a
string and returned an integer.
The I/O support that you need is dictated by the data that you're
communicating. In my case, that consisted of a function to print a
string using lisp syntax for quoting any special characters. For the
return value, atoi sufficed -- the integer return values were known to
be small.
--
Rick Busdiecker <···@lehman.com> and <···@cmu.edu>
Lehman Brothers Please do not send electronic junk mail!
388 Greenwich Street
New York, NY 10013 ``I hate quotations.'' - Ralph Waldo Emerson