Version 9.3.34 is ready for download. Almost all changes are bugfixes
and enhancements to the development environment and tools. Notably
Commandline history handling is simplified a lot by removing a
lot of old code and building on top of the enhanced libedit
extension. Notably, reusing command using !!, !<num>,
etc is now enabled by default.
Epilog now uses the native OS file dialog to ask for files to
consult, edit or create.
Epilog now binds opening a link to Ctrl-click.
Breakpoint feedback has been fixed.
Fixed memory issue and multi-thread access to xpce (thanks to @mike.elston).
Enjoy — Jan
SWI-Prolog Changelog since version 9.3.33
MODIFIED: Use bool types for profiling API Should have low impact.
Used by xpce.
FIXED: Disable Epilog if threads in single threaded version.
MODIFIED: halt/1: forward to main thread. If halt/1 is initiated
from a thread other than main, main is signalled to terminate
the process. If the main thread does not do so within the time
specified by the Prolog flag halt_grace_time (default 1 second),
the process is forcefully terminated.
MODIFIED: Commandline history handling. Comandline history handling
used a double administration, both saving command as Prolog facts and
in the commandline editor. Now the commandline editor is in charge.
Visible changes to the user:
If library(editline) is not available, there is no history.
Without any settings, the history depth is 100. The fact that
the history is enabled is shows using numbers in the prompt.
Substitution using e.g., !!, !<num>, etc. are always enabled.
Setting the Prolog flag history to 0 or false disables the
history. An integer value sets the depth.
COMPAT: Use new prolog:message_action/2
ADDED: prolog:message_action/2 hook. This separates side effects on
messages from printing messages, allowing side effects to take place
even if an earlier print hook suppresses the message.
FIXED: Use library broadcast to tell other components of modified
break-points.
TEST: Do not run the “unprotected” tests if protect_static_code
is set.
FIXED: '$clause_from_source'/4, used for setting break-points.
DOC: Do not run test_installation twice
ENHANCED: xref_source/2: emit warning on late meta_predicate/1 This
directive must appear before the predicate is being used (called).
PPA: Added Ubuntu 25.10 (Questing Quokka)
Package chr
COMPAT: Use new prolog:message_action/2
Package http
COMPAT: Use new prolog:message_action/2
Package libedit
FIXED: Signal handling Detecting this is the main stdin we are reading
from failed since we use dup() on the file handles to avoid closing
them. We now add this fact to the context, initiated before the dup().
UPDATED: prolog:history/2 to support new core functionality.
ADDED: Extended el_history/2 with more actions. This allows for
querying individual events, setting the notion of current, and
searching the history.
ENHANCED: Read old swipl-win.exe history data in current version.
MODIFIED: el_read_history/2 to raise an error if the history file
is invalid.
PORT: Compile if H_SAVE_FP is lacking
ADDED: el_history/2: getsize(-Size) support.
Package pldoc
FIXED: Load when threads are disabled.
COMPAT: Use new prolog:message_action/2
Package plunit
COMPAT: Use new prolog:message_action/2
Package xpce
ENHANCED: Start Epilog file dialog in working directory.
ENHANCED: Make Quit Prolog the default button for confirming close
with open windows.
ADDED: Allow inspecting the GUI hierarchy from Epilog.
ADDED: pce_show_visual_tool/0 to library(man/v_visual). This allows
showing the GUI inspector stand-alone.
FIXED: Block other Prolog threads while a window is being redrawn.
Modifying graphics while a redraw is in progress may result in
inconsistent graphics or crashes.
FIXED: Thread specific module and context object. These two global
variables are used in the xpce interface predicates to keep track of
the context. As xpce allows access from multiple threads they must
be thread specific.
FIXED: Exclude files that require threads for single threaded version.
FIXED: Ensure Prolog exceptions are propagated through xpce.
FIXED: Epilog: save history in all scenarios This covers closing the
main window using the menu, window close button, Ctrl-D, Shift-Ctrl-W.
ENHANCED: Epilog: use native file dialog
ADDED: frame<-open_file and frame<-save_file: use OS dialog
to prompt for a file. These new methods use SDL3’s interface to file
dialog windows to ask for a file for reading or writing. Tested to
work on MacOS, Windows and Fedora using Gnome.
ENHANCED: Do not load theme based on display<-theme if a theme was
already loaded.
FIXED: Use-after-free in frame<-confirm Also allows this method to
run from any thread.
ENHANCED: Show fragment icons vertically aligned in the line.
COMPAT: Use new prolog:message_action/2
FIXED: Show breakpoints in PceEmacs and GUI tracer No longer rely
on messages. There is a problem with the message system where
user:message_hook/3 is both used to redirect messages and to act
on messages. The latter are hooks that fail, the first are hooks
that succeed. It might be better to have two hooks.
FIXED: Possible use-after-free
MODIFIED: Epilog terminal to follow links on Ctrl-click Used
to be simple click. This causes too much unintended actions.
Using Ctrl-click is consistent with other terminal emulators.
Probably not intended. When I started swipl in a directory that had history already, it started counting at 101
$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.3.34)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
101 ?-
After a few commands I was at 106; the oldest command I could access was 6:
106 ?- !1.
! No such event
106 ?- !2.
! No such event
106 ?- !3.
! No such event
106 ?- !4.
! No such event
106 ?- !5.
! No such event
106 ?- !6.
use_module(library(dcg/basics)).
true.
I can see how that somehow makes sense, I don’t know if it is the desired behaviour.
Yes The default history depth is 100. That means that any other command added to the history causes the oldest to be deleted. When saving, it saves all 100 (or as many there are) to a file. Restarting loads these 100 commands and thus the next query is ?- 101.
That is how it works in libedit. The rest is now just some Prolog code around it.
No. The Windows version comes with library(editline). I had to hack the BSD library a bit. That was done by other people, but those ports relied on a lot of other Unix compatibility libraries. I merely replaced some of the low level I/O routines to call native Windows and hard coded that the use of ANSI escape sequences, which is fine for the Windows native consoles as well as the Epilog Prolog consoles.
That is a large part of the beauty of the current code base: it is pretty much the same on all platforms. Before we had a lot of different setups for the console that all had there own peculiar behaviour. Now both swipl and swipl-win behave pretty much the same on Linux/*BSD, MacOS and Windows.
The instructions still look fine. Works for me. You’ll have to work through the details of he messages to see what could be wrong. A good step is running
cmake .
in the build dir. That re-runs the configuration. Normally that is pretty silent, but it will print the things that went wrong while they can easily be missed during the initial cmake run.
80/81 Test #80: json:json_schema .................***Failed 0.51 sec
ERROR: /usr/local/wasm/swipl-devel/build/home/library/ext/json/json_schema.pl:62:
ERROR: source_sink `library(pcre)' does not exist
Warning: /usr/local/wasm/swipl-devel/build/home/library/ext/json/json_schema.pl:62:
Warning: Goal (directive) failed: json_schema:use_module(library(pcre),[re_match/2])
Cannot find JSON Schema test data; skipping tests
Warning: [Thread main] Halting with status 1 due to 1 errors and 1 warnings
81/81 Test #81: ssl:ssl .......................... Passed 6.86 sec
99% tests passed, 1 tests failed out of 81
Total Test time (real) = 84.29 sec
The following tests FAILED:
80 - json:json_schema (Failed)
Errors while running CTest
root@sd-159644:/usr/local/wasm/swipl-devel/build# ninja install
[34/35] Install the project...
-- Install configuration: "PGO"
-- Set runtime path of "/root/lib/swipl/bin/x86_64-linux/swipl" to "/root/lib/swipl/lib/x86_64-linux"
-- Set runtime path of "/root/lib/swipl/lib/x86_64-linux/libswipl.so.9.3.34" to "/root/lib/swipl/lib/x86_64-linux"
-- Set runtime path of "/root/lib/swipl/bin/x86_64-linux/swipl-win" to "/root/lib/swipl/lib/x86_64-linux"
-- Set runtime path of "/root/lib/swipl/bin/x86_64-linux/swipl-ld" to "/root/lib/swipl/lib/x86_64-linux"
root@sd-159644:/usr/local/wasm/swipl-devel/build# swipl --version
SWI-Prolog version 9.3.28 for x86_64-linux
root@sd-159644:/usr/local/wasm/swipl-devel/build#
-- Generating done
-- Build files have been written to: /usr/local/wasm/swipl-devel/build.wasm
root@sd-159644:/usr/local/wasm/swipl-devel/build.wasm# ninja
[590/595] QLF compile library
ERROR: /usr/local/wasm/swipl-devel/build.wasm/home/library/ext/json/json_schema.pl:74:
ERROR: source_sink `library(http/http_open)' does not exist
Warning: /usr/local/wasm/swipl-devel/build.wasm/home/library/ext/json/json_schema.pl:74:
Warning: Goal (directive) failed: json_schema:use_module(library(http/http_open),[http_open/3])
[594/595] Linking C executable src/swipl-web.js
compressing package of size 9606302
compressed package into 5040871
compressed in 606 ms
[595/595] Linking C executable src/swipl-bundle.js
root@sd-159644:/usr/local/wasm/swipl-devel/build.wasm#
Pull the latest version and this should be fixed. When building from git source, please check there are no updates or give the version you try to build.
There is an include file (<signal.h>) missing, though both on MacOS and Fedora 42 it was apparently pulled in indirectly. Added it explicitly to terminal.c, but as you say it didn’t help. That is really weird. SIGWINCH should be defined in any fairly recent Unix-like OS. As the code relies on the grantpt() PTY API, we know we have fairly recent Unix-like OS.
I made the call conditional on whether SIGWINCH is defined, so it will always compile (with a #warning).
The call is needed to make command line editing while resizing Epilog windows work correctly.
I thought I’d verified this. Apparently not (correctly) This reproduces on my Mac. The latest git does compile with a warning. First some other stuff then I’ll try to figure out why.
Its a bit of a mystery. They only define SIGWINCH under some conditions, but I fail to set the right conditions. Setting the right #define while loading <signal.h> is apparently overruled somewhere else Assuming they wont change the signal number I just hard coded it for MacOS if it is missing. That works. If anyone can find a cleaner solution, please make a PR.
Hi Jan, many thanks for all. I just pulled the latest version and you were right, of course, all is fixed now. The wasm version of SWI-Prolog is very nice, very efficient. We are all thankfull for this excellent job. All the best.