forked from SWI-Prolog/plweb-www
/
IDE.txt
119 lines (91 loc) · 5.29 KB
/
IDE.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# 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.
## SWI-Prolog native development tools
### Built-in tools
The built-in tools provide a feature rich evironment 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.
* PceEmacs.txt is a GNU-Emacs clone in XPCE/Prolog, providing
Prolog syntax highlighting based on parsing and
cross-referencing the editor buffer. Colouring highlights variables,
quoted entities, comments, goals (classified as
built-in, imported, local, dynamic and undefined), predicates
(classified as local, public and unreferenced), and file references
(classified as existend/non-existend). PceEmacs is started using
the predicates emacs/0, edit/0 or edit/1.
* The [[graphical tracer][gtrace.txt]] provides source-level
debugging, using three views: your source, variable bindings, and
the stack. The stack view includes choicepoints and visualises
the effect of executing the cut!
* The [[Execution Profiler][profile.txt]] provides a graphical
overview of call and time statistics.
* The [[Cross Referencer][gxref.txt]] analyzes dependencies in
the loaded program and points out undefined and unused code. It
can also generate module headers and import directives based on
the analysis.
* The [[Prolog Navigator][navigator.txt]] provides an
explorer-like view on a directory holding Prolog source files.
Sources files can be expanded in the tree to show predicates,
exports, XPCE classes and methods. Can be used to edit entities
or enable debugging them (spy).
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 (web based Prolog)
[SWISH](http://swish.swi-prolog.org) provides a web-based tool for
running Prolog. It provides a [CodeMirror](https://codemirror.net/)
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 functonality inspired by
[Jupyter/IPython notebook](https://ipython.org/).
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.
- As a public server it can be used to run harmless queries against
a Prolog itself or a read-only database.
- It can be installed with authentication enabled, which allows
for running arbitrary Prolog programs.
- Mixed, where non-authenticated users can run harmless queries and
authenticated users can run anything.
### SWI-Prolog Editor (Windows)
Gerhard Röhner has developed an [integrated Prolog editor](<swieditor:>) 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.
## Support in standard editors
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.
### Using GNU-Emacs
Unfortunately, standard GNU-Emacs Prolog mode is very weak, especially at
handling proper Prolog indentation. The good news is that there is a better
mode today. For more information, see the [[FAQ][</FAQ/GnuEmacs.html>]].
### Eclipse based
$ [Prolog Development Tool - PDT](http://sewiki.iai.uni-bonn.de/research/pdt/) :
The PDT is a Prolog IDE provided as a plug-in for the Eclipse
Platform. All PDT features are implemented for SWI-Prolog, most also for
Logtalk). All native SWI-Prolog development tools (graphical tracer /
debugger, profiler, ...) can be used within the PDT.
$ [Prolog Development Tools - ProDT](http://prodevtools.sourceforge.net/) :
Prolog Development Tools (ProDT) is a Prolog Integrated Development
Environment (IDE) aiming to be as rich in functionality as the Eclipse's
java IDE, giving the developer a single environment where it can control
the development of a Prolog project from code edition, test execution,
debugging, and more...