IPC between a LISP program and a C program 
Author Message
 IPC between a LISP program and a C program

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

617-873-2453                    Cambridge, MA 02138



Sun, 06 Oct 1996 00:22:32 GMT  
 IPC between a LISP program and a C program

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 {*filter*} if
you want to use socket-based ipc.

-- Nicolas.

--
Nicolas Rouquette                      Artificial Intelligence Group

Phone: (818) 306-6916                  4800 Oak Grove Dr.
  Fax: (818) 306-6912                  Pasadena, CA 91109



Sun, 06 Oct 1996 02:42:44 GMT  
 IPC between a LISP program and a C program

   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 {*filter*} 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

Standard disclaimer.



Sun, 06 Oct 1996 22:37:18 GMT  
 IPC between a LISP program and a C program
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.



Mon, 07 Oct 1996 00:34:44 GMT  
 IPC between a LISP program and a C program

   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.

--

  Lehman Brothers          Please do not send electronic junk mail!
  388 Greenwich Street
  New York, NY 10013       ``I hate quotations.''  - Ralph Waldo Emerson



Mon, 07 Oct 1996 23:27:35 GMT  
 IPC between a LISP program and a C program
--> 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.

I understand that there is a Lisp interface to CORBA available from NEC
in Texas. I haven't seen it...I think there are also RPC things
available too.

haven't used any of them yet. I expect to use CORBA before too long,
probably sometime next year.

 -- clint



Sat, 19 Oct 1996 00:26:46 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Help: Executing lisp programs from C-programs?

2. REXX IPC to C programs on OS/2 ?

3. Sockets Programming,IPC,New to Python

4. SoftEng or CS Graduate Program Search

5. Programs needed for CS investigation

6. Call for programs (CS investigation)

7. ST-Programs wanted (CS investigation)

8. SoftEng or CS Graduate Program Search

9. SoftEng or CS Graduate Program Search

10. SoftEng or CS Graduate Program Search

11. Programming Language for Undergrad Intro CS Course?

12. SoftEng or CS Graduate Program Search

 

 
Powered by phpBB® Forum Software