Embedding Swish Inside another Web Application


I’m using:

  • SWI-Prolog version: Threaded, 64 bits, Version 8.2.4
  • Swish: latest commit: d357234613182abcc2953d5b827d367616be8502

I want the code to:

  • Run Swish in parallel to another web application, also using thread_httpd and http_dispatch.


Hello members of the SWI-prolog community,

I’m new to prolog in general, and have been building an SWI-prolog application, who’s front-end is a web application. I have been using the thread_httpd and http_dispatch libraries to create the handlers neccessary to run this web application.

I have found Swish an extremely useful tool, and want it to run alongside the my current program; this will allow structures inside my application to be interacted with in Swish- and vice versa.

What is the reccomended practice for this?

Additionally, I wasn’t sure whether to track this as a full bug, but I tried converting swish’s run.pl file to a module, exporting the run_swish predicate, which I included into my program’s own start-up script. On running this, however- I was met with a syntax error much further down the execution process on runtime:

ERROR: c:/users/127890866/documents/github/orm/extensions/swish-master/lib/page.pl:91:20: Syntax error: Operator expected

Which, when traced looks like so:

I have not modified the operator precidence of the “/” or “//” characters so am not sure what’s causing this.

I hope everyone’s well.