Did you know ... | Search Documentation: |
Program Development Tools |
Next to using any editor capable of editing plain text files and running SWI-Prolog in a separate window there are several options to improve the user experience for the regular Prolog programmer.
The built-in tools provide a feature rich environment for developing with SWI-Prolog. The tools are built on top of the portable XPCE graphics system. They look outdated and the learning curve for the built-in Emacs clone is steep. The real-time semantic highlighting greatly reduces the number of bugs you need to fix after writing your program and the context menu on predicates and goals make it easy to navigate your code.
Similar functionality is now provided for GNU-Emacs using the sweep. See below
Both the Windows Prolog console swipl-win.exe and the app for MacOSX (swipl-win) provides a menu to access many of these facilities directly.
We intend to allow the user to select preferred tools and combine them with whatever they like. In other words, we don't want to force the user into using a bulky all-in-one closed toolkit.
SWISH provides a web-based tool for running Prolog. It provides a CodeMirror based editor with server-enriched semantic highlighting based on the same library as the above mentioned built-in editor. SWISH can display Prolog results as tables, charts and anything supported by HTML5 and JavaScript. SWISH notebooks provide functionality inspired by Jupyter/IPython notebook.
SWISH provides a smooth transition starting with conventional Prolog programs using text output. Next, HTML5 output can be added. Workflows, tutorials, etc. can be written as notebooks that mix text, queries and program fragments as well as embedded web applications that provide a rich experience to non-programmers.
SWISH can run in several configurations.
Gerhard Röhner has developed an integrated Prolog editor in MS-Windows following the conventions of this platform. The embedded SWI-Prolog provides functionality similar to swipl-win.exe, including the possibility to run XPCE GUI programs.
Especially for classroom usage on MS-Windows, you should consider this version. The site also contains some demo material.
The lack of keywords, existence of dynamic operator declarations (see op/3), macro expansion and meta-calling make Prolog a difficult language for generic editors and IDEs. On the other hand, switching between editors is hard and thus most people like using one editor for all their tasks. Below are plugins for generic editors that we are aware of. Please let us know if you know other plugins.
Unfortunately, standard GNU-Emacs Prolog mode is very weak, especially at handling proper Prolog indentation. The good news is that there is good Emacs Prolog mode available as sweep. This mode is similar to the built-in PceEmacs. The mode replies on embedding SWI-Prolog as an Emacs module. The required foreign library is bundled with the binary distributions of Prolog. Requires SWI-Prolog 8.5.20 or later.