Dear SWI-Prolog user,
SWI-Prolog 9.3.32 is ready for download. There are many changes in
this release. Highlights:
-
Performance. A small change to the VM interpreter as well as
enablinggcc -O3improved performance on i86_64 by over
20%. The VM change and better tuning more than doubles the
performance of the WASM version. -
Preliminary changes to dict handling for synchronization with
the PIP working group:- Use of
_{...}(unbound key) is going to be deprecated.
#{...}is the new syntax for anonymous dicts. - For the dict built-ins,
#now matches any tag. - The
Var{key: Value, ...}syntax is optionally used for
attributed variables as well as writing terms that are not
trees, but arbitrary directed graphs (including rational
trees/cyclic terms). This version implements the current
state of the proposal. Details may change.
See the Prolog flag
var_tagfor controlling compatibility. - Use of
-
library(uri) has now support or
urnURIs. -
Several enhancements to the GUI:
- Bugfix in xpce thread handling caused undefined methods
if multiple threads try to lazily bind a method. - Proper copy from Epilog consoles
- Avoid illegal UTF-8 sequences when handling fast streaming
output in Epilog consoles. - Fixed backspace handling in incremental search
- Make keyboard selection management work properly in PceEmacs.
- Avoid errors when making the thread monitor too small.
- Bugfix in xpce thread handling caused undefined methods
-
Several portability issues by @mgondan.
Enjoy ā Jan
SWI-Prolog Changelog since version 9.3.31
-
ADDED: Implement read_term/1: implement reading attributed and
labeled terms. This patch supports Var{Attr: Value, ā¦} if the
Prolog flagvar_tagis set toattvar. This allows reading terms
with attributes. It also supports labeled subterms that allows to
read terms that are directed graphs rather than trees. This includes
cyclic terms. For this we reserve the attributed=. For example?- A = X{= : f(X)}.Binds A to a cyclic term equivalent to executing
X = f(X). This is
part of ongoing discussions in the PIP working group. It is currently
implemented by ECLiPSe and SWI-Prolog. -
DOC: Updates documentation for using of # anonymous dicts.
-
TEST: Update tests for use of # anonymous dicts
-
MODIFIED:
Dict.put(Path, Value): create new dicts as#{...}. -
MODIFIED: select_dict/3 handling of
#tag The#tag matches any tag
at the other end and the dict holding the remainder has the#tag. -
MODIFIED: write_term/2 using attributes(write) This now writes
Var{Att1: Value1, Att2: Value2, ...}, which is valid syntax for
read_term/2 if the Prolog flagvar_tagisattvar. -
ADDED: read_term/2 and friends to respect the new
var_tagflag. -
ADDED: Prolog flag
var_tagDefines how Var{ā¦} terms are
interpreted. This commit only implements setting and getting the flag. -
MODIFIED:
:</2and>:</2: match#tag The tag#matches any
tag on the other side without instantiating the tag. -
FIXED: instantiation errors on prolog_frame_attribute/3 on exceptions.
-
FIXED: Exception details from
'$tmp_file_stream'/4 -
ERROR: Domain error:
encoding' expected, foundtxtāThe txt does not make sense * CLEANUP: Fixed more compilation warnings
when using -O3 -
BUILD: Fix PGO building for AppleClang
-
BUILD: Fix PGO build for Clang. This now does optimize.
-
BUILD: Changed default optimization for gcc to -O3 Earlier tests showed
no noticeable difference, but using gcc-15 and setjmp()/longjmp out
of the way we get about 15% improvement. -
SANDBOX: Declare string quasi quotation syntax as safe.
-
TEST: Fix format_time/3 tests by setting correct timezone.
-
WASM: Set defaults for best performant build.
-
ENHANCED: Move setjmp() out of the VM main function Using setjmp()
harms register allocation, which slows down the VM. Some data points:
Clang: 6% (Clang-17 on Apple M1 as well as Clang-20 on AMD3950X),
GCC: 13% (GCC-15 on AMD3950X), WASM: 35% (Emscripten 4.0.15 on Node.js
22.19 on AMD3950X). MinGW-14: 18% (Windows binary running on AMD3950X
under Wine). -
TEST: Fixed ration number writing test to work regardless of flags.
Test failed when run withrational_syntaxset tonatural. -
ENHANCED: Get rid of setjmp/longjmp() in PL_next_solutions() This
improves performance by about 12%. It does make a couple of scenarios
for stack overflow handling impossible though. This patch merely
introducesO_THROWas C macro to enable/disable this. -
WASM: Make setting CFLAGS and LDFLAGS in BuildType.cmake work The
if/elseif/⦠selection triggered on Clang. -
WASM: Compile VM using
-O2This produces a smaller binary with
slightly better performance. -
WASM: When using a monolithic PL_next_solution(), use
-O1in
Debug mode Otherwise local variables with non-overlapping scope are
not merge, causing an Emscripten compiler error -
WASM: Do not build
swipl-winAlso cleanup handling platform-dependent
cmake options -
FIXED: Provide random_property/1 when compiled with LibBF.
-
FIXED: When a REPL loop receives the halt/0,1 exception, make
it return. Before, if non-threaded or the REPL loop runs in the
main thread, terminate the process. Otherwise halt/0 was ignored.
The behaviour for the main thread is still the same, but prolog/0
succeeds in other threads if the thread calls halt/0.Possibly we should add a flag to control this behaviour, i.e. whether
or
not halt/0 inside prolog/0 terminates the process or merely the
REPL loop.
Package archive
- CLEANUP: Avoid undefined warnings for
gcc -O3
Package bdb
- CLEANUP: Avoid undefined warnings for
gcc -O3
Package clib
-
FIXED: crypt/2 on Windows using bsd-crypt.c: possible memory
corruption. -
FIXED:
urn-schema URIs can have a query and fragment field. -
MODIFIED: library(uri) to raise more exceptions and support URNs.
-
FIXED: directory_member/3: respect file_type(regular) option This
allows ādirectory_member/3ā to generate regular (non-directory)
files with option āfile_type(regular)ā, in accordance with how
āabsolute_file_name/3ā treats this option. -
CLEANUP: Avoid undefined warnings for
gcc -O3
Package http
-
FIXED: Possible uninitialized variable (in error case)
-
SANDBOX: Declare Quasi Quotations for json, html and javascript
as safe. -
ADDED: json quasiquotation syntax This allows for embedding JSON
documents represented as a Prolog dict using e.g.?- X = 10, D = {|json(X)||{"x": X}|} D = _{x:10}.
Package libedit
- CLEANUP: Avoid undefined warnings for
gcc -O3
Package mqi
-
PORT: Search for python3 executable to try python3 and then python.
Modern systems are beginning to install onlypython, which is
Python3.There isnāt any support for python2 anymore, since 2020, and the
windows installer does not install a python3.exe.
Package odbc
- CLEANUP: Avoid undefined warnings for
gcc -O3Also replaces local
error functions with calls toPL_*_error()
Package semweb
- CLEANUP: Avoid undefined warnings for
gcc -O3
Package sgml
- CLEANUP: Avoid undefined warnings for
gcc -O3
Package ssl
- CLEANUP: Avoid undefined warnings for
gcc -O3
Package table
- CLEANUP: Avoid undefined warnings for
gcc -O3
Package tipc
- CLEANUP: Avoid undefined warnings for
gcc -O3
Package xpce
-
FIXED: Lazy binding of Prolog methods was not thread-safe.
-
FIXED: Make double and triple click in Epilog copy the selection
properly. This set the selection twice from an event, which apparently
causes SDL3 to reset the selection. -
FIXED: Incremental search backspace handling
-
CLEANUP: Avoid undefined warnings for
gcc -O3 -
FIXED: Emacs mark+move cursor to maintain an active selection.
-
FIXED: Correctly handle UTF-8 console output if the buffer ends with
an incomplete UTF-8 character. -
FIXED: PceEmacs: make shift-caret movement extend the selection.
Selection is now deactivated without shift. -
FIXED: Resizing the thread monitor too small leads to a type error.
Reported by @mike.elston