Pengine and Prolog scratchpad
HTML JavaScript Prolog CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

A Prolog Engine application server

This repository provides a demo application server for the SWI-Prolog pengines package. An online version of this server is available at

The application server currently hosts two applications:

  • Scratchpad allows you to create interactive web applications that query Prolog. This demonstrates how pengines are supposed to be used: Prolog acts as a modular query language, while JavaScript handles the results of Prolog queries to vizualise the result.

  • SWISH provides a Prolog environment for trying Prolog, teaching, make a piece of code available for inspection to others, collaboratively solve a problem, etc. SWISH runs also as a stand-alone server

Local installation installation

Running this software typically requires the latest development version of SWI-Prolog. After cloning the pengines repository, the server can be started by loading into SWI-Prolog. On MS-Windows, this implies opening in the explorer. On Unix systems, run


By default, only Scratchpad is available. See below for adding SWISH.

Installing SWISH locally

First, add the swish submodule by running this command

git submodule update --init

Next, install bower for your platform, go to the directory apps/swish and run

bower install
make src

Finally, restart the pengines server.


A Docker file is available from