Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!purdue!decwrl!tc.pw.com!news
From: Don Ferguson <ferguson@tc.pw.com>
Subject: Re: linking a Prolog program into an HTTPD
Content-Type: text/plain; charset=us-ascii
Message-ID: <32822139.1392@tc.pw.com>
Sender: news@tc.pw.com
Nntp-Posting-Host: ivy.tc.pw.com
Content-Transfer-Encoding: 7bit
Organization: Price Waterhouse
References: <55qu7g$31g@wuff.mayn.de> <tom-0611962034320001@c75.rahul.net>
Mime-Version: 1.0
Date: Thu, 7 Nov 1996 17:49:45 GMT
X-Mailer: Mozilla 3.0 (WinNT; I)
Lines: 30

> > If some heroic person wanted to do the Prolog community a big service,
> > then trying to do this, succeeding, and writing a detailed howto for
> > the major commerical Prolog's would be it.
> 
> I think the clever way of doing this is to have a Prolog server that is
> interacted with via java applets or cgi scripts: you don't need to link
> the Prolog app into httpd.

I have done this.  The Prolog process is a server that listens for
requests
on a fixed port (using Tom Howland's fine TCP Library, distributed with 
Quintus Prolog).  The cgi-bin program is a small C executable that
connects
to the port, stuffs a goal down the wire, and writes the resulting HTML
to
stdout.

I have also tried having Java connect directly to the Prolog socket. 
This works,
but some firewalls block non http traffic, so I switched to having the
applet
communicate with Prolog via the cgi-bin program (In Java, you can open
and
read from arbitrary URL).

Anyway, if anyone is curious, check out http://edgarscan.tc.pw.com
which provides access to the financial data of public US corporations
with data
(extracted by Prolog) from the SEC's EDGAR database.  You'll be asked to
register, but it doesn't cost anything.
