Re: Help. invoke a swi-prolog program within an html page
From: Jan Wielemaker (jan_at_ct.xs4all.nl)
Date: 01/31/05
- Previous message: Jan Wielemaker: "Re: Swi-Pce: text items too large"
- Next in thread: Nick Wedd: "Re: Help. invoke a swi-prolog program within an html page"
- Reply: Nick Wedd: "Re: Help. invoke a swi-prolog program within an html page"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 Jan 2005 16:45:00 GMT
On 2005-01-31, Norbert E. Fuchs <fuchs@ifi.unizh.ch> wrote:
> In article <34j3dmF4b3e8rU1@individual.net>,
> "Gustavo Rodas" <guaron@hotmail.com> wrote:
>
>> Hi,
>>
>> Can I invoke a SWI-Prolog program within an HTML program?
>> If so, how can I pass input to the program and take
>> output from it?
>>
>> Your help will be greatly appreciated.
>
>
> Have a look at the Pillow Web Programming Library
>
> http://www.clip.dia.fi.upm.es/Software/pillow/pillow_doc_html/pillow_doc_
> toc.html
>
> where it says
>
> The PiLLoW library ("Programming in Logic Languages on the Web") is a
> public domain Internet/WWW programming library for Logic Programming
> Systems which simplifies the process of writing applications for such
> environment. The library provides facilities for generating HTML or XML
> structured documents by handling them as Herbrand terms, producing HTML
> forms, writing form handlers, processing HTML templates, accessing and
> parsing WWW documents (either HTML or XML), accessing code posted at
> HTTP addresses, etc.
Pillow is one way. SWI-Prolog itself comes with libraries too. Only,
the question is much underspecified. First of all, I don't think you
can speak about `An HTML program'. That would imply it is a programming
language. Its not even Turing complete. What does invoke a (SWI-)Prolog
program from HTML mean? In my reading javascript and other client-side
embedded code could be called `invoking XYZ'. I do not know whether
Pillow provides server-side embedded Prolog (like PHP for example).
I once wrote that (it still runs the SWI-Prolog application DB), but
never documented it.
Things that can be done is to use Prolog as a CGI scripting language.
There is nothing special here. To make it easy there is a library for
fetching CGI form data (see package clib). You can also server the
pages directly from Prolog using the HTTP package. This also contains
a library `handling them as Herbrand terms': html_write.pl. I'm still
not sure this is ideal. From a software design point of view it is
the way to go, I guess. Especially novices prefer using format (or
even write) though and it takes a lot of effort to convince them
otherwise.
Cheers --- Jan
- Previous message: Jan Wielemaker: "Re: Swi-Pce: text items too large"
- Next in thread: Nick Wedd: "Re: Help. invoke a swi-prolog program within an html page"
- Reply: Nick Wedd: "Re: Help. invoke a swi-prolog program within an html page"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|