# Ann: SWI-Prolog 9.3.35

**URL:** <https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393>\
**Category:** Releases\
**Created:** [November 19, 2025, 2:02pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393 "2025-11-19T14:02:55Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [November 19, 2025, 2:02pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/1 "2025-11-19T14:02:55Z")

</div>

Dear SWI-Prolog user,

SWI-Prolog 9.3.35 is ready for download. This is a **pre-release for  
10.0.0**. As from now, only minor patches will be applied until  
version 10 is out and a new development branch is created. Highlights:

- Sync format/1-3 with PIP-0110, adding additional tests produced  
by Joachim Schimpf. This fixes a couple of bugs and adds some  
minor features. The only incompatible change is that `~Ns` now  
performs right padding with spaces if the argument is shorter than  
N characters.

- process\_create/3 got a pseudo path `prolog`, allowing for  
process\_create(prolog(‘swipl-ld’), …) to reliably call the  
SWI-Prolog linker frontend that belongs to the running Prolog  
process. After discussion with @mgondan1 to solve issues running  
the saved-state tests.

- Make the whole system compile using MSVC on Windows.

- Better MacOS Homebrew support for using the dependencies from  
Homebrew.

- Various fixes to the commandline handling. Line editing now by  
default use a bundled version of libedit that works on Windows  
and includes upstream patches to define the _word characters_  
that are available in most distributions yet. Also fixes  
colour handling for the flatpak version. Fix issues with  
resizing the Epilog windows.

- Added library(json\_schema), providing JSON schema checking.

- XPCE:

# SWI-Prolog Changelog since version 9.3.34

- ADDED: Using the option `--home=dir`, set `SWI_HOME_DIR`.  
This ensures that sub processes can access Prolog’s home and, when  
calling Prolog, execute the same Prolog system.

- TEST: Base saved-state tests on new prolog(Tool) option of  
process\_create/3.

- FIXED: Allow `swipl -o exe -c input.pl` to pass `--home=dir`  
option.

- PORT: Properly install runtime dependencies for MSVC build This now  
depends in CMake \> 3.21 install() option `RUNTIME_DEPENDENCY_SET`

- PORT: Build `swipl-win.exe` under MSVC Now compiles cleanly.  
`swipl.exe` runs fine, including line editing. The GUI is unresponsive  
though.

- FIXED: format/1-3: reset last tab stop on a newline. Spotted by  
Joachim Schimpf with the PIP tests.

- ADDED: ansi\_format/4, formatting with colours to a stream.

- PORT: MSVC

- MODIFIED: format/2 handling of non-list arguments Now, the second  
argument is only considered a single argument if it is not or [_|_].  
Notable partial lists or lists not ending in `[]` are now threaded as  
(invalid) argument list.

- ENHANCED: Errors for arithmetic expression `[Code]` if list holds no  
single code.

- PORT: MSVC compatibility.

- TEST: Fixed test for format/2 `~6s`.

- DOC: format and friends. Move documentation of deprecated `writef/2`  
and friends to the library documentation. Updated the format/1-3  
documentation.

- PIP: PIP-0110: make `~<n>s` emit padding if text is too short.

- TEST: Use `swipl.bat` for testing saved states on Windows. 1. allows  
for “external” swipl.bat under Windows (see swipl.sh in l. 133)  
2. invokes saved state with -x if swipl.bat is used

- PORT: Work around broken MSVC

- TEST: PIP-0110: added PIP format/2 tests.

- COMPAT: Extended ECLiPSe test driver to accept `should_output`

- MODIFIED: PIP-0110: format/2 using `~N` to ignore the argument.  
Most implementations ignore the argument. Others interpret it  
inconsistently. New code should use `~N~2n` as replacement for  
`~3N`.

- MODIFIED: PIP-0110: distributing extra spaces over `~t` Used to  
distribute these spaces from the middle. Now distributes them from  
the right, compliant with SICStus and ECLiPSe.

- ADDED: PIP-0110: format/2 format specifier `F`. This is like `f`,  
but using uppercase letters for non-normal floats.

- PIP: PIP-0110: format/2: `~a` to only accept atoms and compact strings.

- PIP: PIP-0110 (format) compatibility: handle expressions for `*`

- PORT: Better MacOS Homebrew support

- FIXED: Typo in updated history code. Caused !/0 to be redefined …

- FIXED: `!<num>` history handling if command contains a . in the  
middle.

- FIXED: library(ansi\_term): use initialization/1 If not used, the  
setup init\_color\_term\_flag/0 will not run when using .qlf files.

## Package bdb

- PORT: Honour `LIBBDB_ROOT_DIR` cmake variable

## Package clib

- ADDED: process\_create/3: specify program as prolog(Tool) This allows  
Prolog running one of its tools, with the guarantee that we use the  
tools from the same version. This provides a hook prolog:prolog\_tool/4  
that allows embedded systems to redefine how the Prolog tools should  
be executed.

- FIXED: Make library(uuid) work properly if autoloading is disabled.

## Package json

- TEST: Skip JSON schema tests if we have no HTTP server

- BUILD: Only include library(json\_schema) if `pcre` is provided.

- FIXED: Make compile if there is no HTTP client support.

- ADDED: library(json\_schema) to provide checking JSON schema.

## Package libedit

- PORT: Clean compilation on MSVC

- PORT: Allow using bundled libedit This is the default. The system  
version can be selected using `cmake -DSYSTEM_LIBEDIT=ON`.  
This should simplify building

- ADDED: el\_set/2 to set the word characters This replies on el\_wset()  
using `EL_WORDCHARS` that is provided in some recent copies of  
`libedit`. When available, it is used to set the word chars to only  
`"_"` (in addition to iswalnum()).

- FIXED: Avoid full refresh in Epilog windows on each action. Failed to  
reset the refresh request. Refreshing causes issues with wrapped  
lines.

- FIXED: Synchronise Epilog window size changes with libedit.

## Package pldoc

- FIXED: Emit LaTeX for markdown code text that holds `%` in tables.

## Package utf8proc

- PORT: Compile using MSVC

## Package xpce

- PORT: Fixed emulation of C11 atomic\_compare\_exchange\_strong()

- PORT: Compilation in MSVC This is only a partial port to MSVC.  
It does fix several issues though.

- FIXED: If there is no gui, do not setup xpce for lazy loading.

- PORT: Hack around MacOS oddities to get `SIGWINCH`

- PORT: Make compilation succeed if SIGWINCH is not defined.

- FIXED: Message handling. Broke emacs/0. Reported by @mike.elston

- FIXED: `swipl-win` to handle interrupt in the console that started  
swipl-win. What should we do if there is no terminal, i.e., if  
swipl-win is started as app directly from the GUI? It should not  
get interrupt signals in that case, but what if it gets one anyway?

- ADDED: Epilog: use pthread\_kill() to update client thread of window  
size change. This fixes resizing Epilog windows cooperation with  
libedit. To work correctly, the libedit package must be updated  
as well.

- ENHANCED: Detection of when to load library(pce).

- ADDED: Epilog: Shift-Ctrl-M to inject make/0.

- MODIFIED: Removed all PostScript related support This was  
non-functional anyway. The Cairo graphics is used to implement  
`graphical->pdf` for generating PDF. This functionality is still  
rather minimal. It will be extended in the future.

- FIXED: Colour for class `int_item` up/down arrows. And some code  
cleanup.

- ENHANCED: class `font_item` to reflect current possibilities better.

- ENHANCED: Updated PceDraw - Use native file dialog for save, load  
and export - Remove windows metafile support - Replace Postscript  
output with PDF - Disable printing. Not supported by SDL and not  
very important.

- DOC: Revive the XPCE User Guide This commit re-adds the `Makefile`,  
updates the Prolog helpers and minimal updates to reflect some aspects  
of XPCE version 7 in the documentation.

- ADDED: `graphical->pdf` to write PDF to a file

- FIXED: Always enable color on the Epilog consoles.

---

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [November 20, 2025, 8:00am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/2 "2025-11-20T08:00:26Z")

</div>

I experience a problem with saved states under MSYS2. Maybe more than one problem, but let’s fix it one by one.

1. After compilation, src/swipl succeeds, also check\_installation, so “build\_home.pl” does everything correctly.
2. ctest fails, though. It creates the saved state, but reports problems with running it. I’ll be more specific later.

```prolog
$ ctest -R save

```

1. I added a debug(save(keep)) to test\_saved\_states.pl so that I can run the exe-files manually.

```prolog
$ ./test_saved_1_9440.exe
ERROR: [Thread main] c:/msys64/home/matth/mingw-packages/mingw-w64-swi-prolog/src/build-ucrt64/home/library/ext/clib/filesex.pl:91: Initialization goal raised exception:
ERROR: [Thread main] Das angegebene Modul wurde nicht gefunden. 

```

1. (this should read as “4.“): If I manually copy files.dll in the current folder, the state executes normally.

```prolog
$ cp src/files.dll .
$ ./test_saved_1_9440.exe
true.

```

Some “win\_add\_dll\_directory” seems to be missing, that adds ~/mingw-packages/mingw-w64-swi-prolog/src/build-UCRT64/src to the DLL search path. But where do I put this directive? I guess it needs to be placed in the “ressource” of the saved state (?). Moreover, I don’t know from where to obtain this path.

1. For what it’s worth, the state executes normally with swipl -x (even if files.dll is not in the current folder):

```prolog
$ rm files.dll .
$ src/swipl -x ./test_saved_1_9440.exe
true.

```

1. I can fix the problem by adding –foreign=copy when creating the state, but that’s not pretty.

---

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [November 20, 2025, 9:02am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/3 "2025-11-20T09:02:33Z")

</div>

Ok, I was in error, sorry. (I see you typing)

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [November 20, 2025, 9:03am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/4 "2025-11-20T09:03:20Z")

</div>

I see. This is a bit weird as the logic for running the state has not changed. The preparation is done by `set_windows_path/0` in `test_saved_states.pl`.

> [@mgondan1](#):
>
> Ok, I was in error, sorry. (I see you typing)

I’ll wait …

---

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [November 20, 2025, 9:03am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/5 "2025-11-20T09:03:31Z")

</div>

The problem is solved by set\_windows\_path in test\_saved\_states (exactly as you write). I’ll play around a bit more and then report the second problem.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [November 20, 2025, 9:05am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/6 "2025-11-20T09:05:33Z")

</div>

> [@mgondan1](#):
>
> The problem is solved by set\_windows\_path in test\_saved\_states.

Now I’m confused. That is already there, so what needs to change? Anyway, I guess I’ll see a PR? 🙂

---

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [November 20, 2025, 9:20am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/7 "2025-11-20T09:20:20Z")

</div>

I hope I can provide something meaningful.

1. The first thing that comes to my attention is that SWI\_HOME\_DIR is set explicitly under msys2.\* This does not seem necessary anymore (?), and may even be wrong in those situations where prolog\_tool points to a different prolog system with its own home directory.

\*I am aware that I suggested to introduce it. Sigh.

1. All right. Found the culprit: set\_stream(In, timeout(60)) does not seem to work under Windows. Do you mind if I “comment it out“ like this?

```prolog
read_terms(In, List) :-
    ( current_prolog_flag(windows, true)
    -> true
    ; set_stream(In, timeout(60))
    ),
    read_term(In, T0, []),
    read_terms(T0, In, List).

```

PR is on the way

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [November 20, 2025, 10:36am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/8 "2025-11-20T10:36:04Z")

</div>

> [@mgondan1](#):
>
> The first thing that comes to my attention is that SWI\_HOME\_DIR is set explicitly under msys2.\* This does not seem necessary anymore (?), and may even be wrong in those situations where prolog\_tool points to a different prolog system with its own home directory.

Looks safe to me. The Prolog tool is designed to run tools that belong to the same Prolog installation, so it should have the same home. Of course you can make the hook do something else …

> [@mgondan1](#):
>
> set\_stream(In, timeout(60)) does not seem to work under Windows.

It is indeed something that was added in this version of the tests to ensure the test terminates. Hmm. Works fine in my build. What are the symptoms? I rather have this fixed then disabling it 🙂

---

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [November 20, 2025, 11:44am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/9 "2025-11-20T11:44:43Z")

</div>

That is the complaint (“not a socket”):

```prolog
% [1/3] saved_state:true .......................... **FAILED (0.586 sec)
ERROR: [Thread main] c:/msys64/home/c7201178/swipl-devel/tests/save/test_saved_states.pl:229:
ERROR: [Thread main] test saved_state:true: received error: read_term/3: I/O error in read on stream <stream>(0000021965146690) (not a socket)

```

It goes away if I remove the set\_stream/2 command. FWIW, you might wish to reduce the timeout to 5 seconds instead of 60 🙂

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [November 20, 2025, 12:13pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/10 "2025-11-20T12:13:44Z")

</div>

> [@mgondan1](#):
>
> That is the complaint (“not a socket”):

Ok. I was wrong. The tests worked on Windows, but after adding the timeout I did not recheck. Sorry. So, your PR is fine. Can you lift the _Draft_ state?

And no, this cannot be fixed as th underlying poll/select functionality is only present for sockets on Windows.

> [@mgondan1](#):
>
> FWIW, you might wish to reduce the timeout to 5 seconds instead of 60 🙂

No. Some of the builds and tests are executed on extremely slow (often emulated) hardware. It is just to avoid blocking for hours.

---

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [November 20, 2025, 4:48pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/11 "2025-11-20T16:48:24Z")

</div>

I think swipl-9.3.35.tar.gz lacks the contents of packages/libedit/libedit. There’s just a single file, CMakeLists.txt. In contrast, swipl-devel from git has a few more.

```prolog
c7201178@PC105-C720 UCRT64 ~/MINGW-packages/mingw-w64-swi-prolog/src/swipl-9.3.35
$ ls packages/libedit/libedit/
CMakeLists.txt

c7201178@PC105-C720 UCRT64 ~/MINGW-packages/mingw-w64-swi-prolog/src/swipl-9.3.35
$ ls ~/swipl-devel/packages/libedit/libedit
CMakeLists.txt ChangeLog Makefile.am README.md acinclude.m4 cmake config.guess config.h.in configure depcomp examples libedit.pc.in m4 src
COPYING INSTALL Makefile.in THANKS aclocal.m4 compile config.h.cmake config.sub configure.ac doc install-sh ltmain.sh missing

```

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [November 20, 2025, 6:09pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/12 "2025-11-20T18:09:42Z")

</div>

> [@mgondan1](#):
>
> I think swipl-9.3.35.tar.gz lacks the contents of packages/libedit/libedit.

True. This has been fixed in `scripts/make-src-tape`. That is a problem for Windows builds based on the archive. On other systems it will fall back to the system libedit. The only way to fix that is releasing 9.3.36 …

---

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [November 20, 2025, 6:56pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-35/9393/13 "2025-11-20T18:56:04Z")

</div>

Success!

With two little patches (timeout, see above, and the lack of winlibedit), swipl-9.3.35 now runs on MSYS2 🙂 with check\_installation and test\_installation passing all tests—except for jpl and java, which I haven’t looked at yet, and won’t look soon.
