Re: Help. invoke a swi-prolog program within an html page

From: Jan Wielemaker (jan_at_ct.xs4all.nl)
Date: 01/31/05

  • Next message: Maurizio Ferreira: "Re: Swi-Pce: text items too large"
    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


  • Next message: Maurizio Ferreira: "Re: Swi-Pce: text items too large"

    Relevant Pages

    • Re: ASP.NET Internationalization bug?
      ... I'm trying to explain why your, or my, workaround to the bug I've found is ... inline programming in .aspx pages is just as effective as ... I don't see too clearly the purpose of declaring a single language ... HTML and XHTML standards. ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: ASP.NET Internationalization bug?
      ... The Microsoft team has confirmed the bug. ... For every programming team that works like you do, ... I don't see too clearly the purpose of declaring a single ... which is not as appropriate as HTML and XHTML ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: an old geezer running visual studio for the first time
      ... Consider developing your aspx and ascx files in FrontPage, Dreamweaver, ... > definitely NOT the place to write HTML - so no need for you to think about ... Familiarize yourself with the starter kits at the following link: ... >> I have done quite a bit web programming, ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: DotNet is behind where we were with VB, about a dozen years ago
      ... >> love programming in C# and VB.Net almost equally, ... >> even a Microsoft vs Java or Flash or competing technology problem. ... >> information technology field came along, with HTML on their brain. ... >> But as a development platform, a web BROWSER, which is suited for ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: an old geezer running visual studio for the first time
      ... Consider developing your aspx and ascx files in FrontPage, Dreamweaver, ... NOT the place to write HTML - so no need for you to think about grid vs flow ... Programming ASP.NET - by Dino Esposito - Microsoft Press. ...
      (microsoft.public.dotnet.framework.aspnet)