Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!godot.cc.duq.edu!newsgate.duke.edu!zombie.ncsc.mil!nntp.coast.net!lll-winken.llnl.gov!ames!cnn.nas.nasa.gov!eos!kronos.arc.nasa.gov!ptolemy.arc.nasa.gov!kpc
From: k p c <kpc@ptolemy.arc.nasa.gov>
Subject: Re: TCP/IP in Allegro CL?
In-Reply-To: radev@news.cs.columbia.edu's message of 3 Jun 1996 18:32:02 -0400
Message-ID: <1996Jun7.080040.28461@ptolemy-ethernet.arc.nasa.gov>
To: radev@news.cs.columbia.edu (Dragomir R. Radev)
X-Disclaimer: No organization, company, or government is represented here.
X-Attribution: kpc
Lines: 43
Sender: usenet@ptolemy-ethernet.arc.nasa.gov (usenet@ptolemy.arc.nasa.gov)
Nntp-Posting-Host: phenotype.arc.nasa.gov
Reply-To: kpc@ptolemy.arc.nasa.gov
Cc: kpc@ptolemy.arc.nasa.gov
Organization: NASA Ames Research Ctr, Information Sciences Div and Aero Facil
	Branch.  Disclaimer: neither a civil servant nor a representative.
References: <4ovp52$155@ground.cs.columbia.edu>
Date: Fri, 7 Jun 1996 08:06:26 GMT

You might try my current approach: wrap the Lisp executable with a
small dispatcher program written in C or the language of your choice
that connects standard output/input/error of the Lisp executable to
the socket.

Advantages include:

	o The C program (in your case, another language) is simple and
	  small and uses available expertise and libraries.
	o FFI and sockets are not ANSI standard.  Fewer problems
	  switching Lisp implementations.
	o Complex dispatching can occur without requiring processes in
	  Lisp, which are not ANSI standard.

Disadvantages include:

	o Have to be certain of standard input/output/error behavior
	  and blocking in the Lisp implementation.
	o Have to handle standard error (1) with a second socket, (2)
	  by folding it with standard output, or (3) by using a
	  protocol to switch between them (you would have to handle
	  standard error anyway, but in this approach I think you are
	  at the mercy of the implementation's mapping of error output
	  to Unix standard error as above).
	o Have to use another language than Lisp (you would have to do
	  that anyway unless you use a Lisp that has the equivalent of
	  Allegro's open-network-stream).

I'm interested in comments on this approach, as I have not implemented
it yet.  It seems less troublesome than dealing with making a server
out of Lisp nonstandardly.

I'm somewhat surprised not to hear of freeware that takes an
executable and a socket address and connect them to each other.  Seems
like such a useful task.  You can almost implement it in a few lines
of sh using telnet (the problem is the lack of a two-way pipe).

If you post a followup to this article, I would appreciate a courtesy
verbatim copy by email to help work around potentially unreliable feeds.

---
kpc@ptolemy.arc.nasa.gov.  AI, multidisciplinary neuroethology, info filtering.
Noone's feared, detested, shunned, or molested like the man who might be right.
