# Ann: SWI-Prolog 8.5.4

**URL:** <https://swi-prolog.discourse.group/t/ann-swi-prolog-8-5-4/4786>\
**Category:** Releases\
**Created:** [December 19, 2021, 3:49pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-5-4/4786 "2021-12-19T15:49:27Z")\
**Posts on this page:** 3\
**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:** [December 19, 2021, 3:49pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-5-4/4786/1 "2021-12-19T15:49:27Z")

</div>

Dear SWI-Prolog user,

SWI-Prolog 8.5.4 is ready for download. Highlights:

- MODIFIED: the brace\_terms option of write\_term/2,3 now behaves  
as documented. Old behavior was the inverse of the documented  
behavior.

- @peter.ludemann did a lot of work on library(rbtrees) to make  
it more robust using the =\> rules and det/1 declarations and  
extend the test suite.

- Following the tip by @swi to show the last open choice point  
there is now print\_last\_choicepoint/0 as well as a new option  
to a toplevel answer: by typing `*` the system will print the  
details on the last choicepoint.

- There is somewhat experimental support for terminal hyperlinks,  
also suggested by @swi. To use this, put  
`:- set_prolog_flag(hyperlink_term, true).` in your init file.

- Most of the work is in updating the MacOS port

# SWI-Prolog Changelog since version 8.5.3

- PORT: On MacOS fat executables, both try fat-darwin and the actual  
archirecture when searching foreign resources.

- PORT: Set archirecture name of fat packages to `fat`.

- PORT: Support generation of MacOS universal (fat) binaries.  
Also updates minimum supported MacOS version to 10.14.

- PORT: Dynamically determine actual architecture on MacOS

- PORT: Install openssl.cnf with MacOS dependencies  
(scripts/macos-deps.sh)

- PORT: By default disable tcmalloc for MacOS as it causes a crash in  
setlocale() for Monterey.

- ADDED: Support ‘\*’ to print the most last choicepoint when a toplevel  
goal succeeded deterministically.

- ADDED: print\_last\_choicepoint/0,2.

- ENHANCED: Make explain/1 use the message system and the new terminal  
hyperlinks.

- ENHANCED: explain/1: hide system references.

- PORT: Building an apple bundle using Qt6

- PORT: Updated script for MacOS dependencies

- DOC: return type for PL\_put\_variable(), PL\_put\_bool() and PL\_put\_atom()  
is `int`.

- ENHANCED: ord\_subtract/3: use =\> rules to trap wrong calls and stop  
when the list of elements to be subtracted is exhausted.

- FIXED: Handle new terminal hyperlink elements in message\_to\_string/2

- PORT: MacOS to deal with installation directory for libjpeg as  
installed by Macports. This patch also disables more Macports and  
Homebrew locations if we provide our own dependencies.

- BUILD: By default use Macports gcc11 (gcc-mp-11)

- EHNANCED: SICStus datime/2 emulation now supports mode datime(-When,  
+Datime).

- ADDED: ansi\_term:hyperlink/2 as a hook to adding hyperlinks.

- ADDED: random\_subseq/3 and random\_numlist/4 to  
library(random). Compatible with SICStus.

- ENHANCED: Use new url(Location) message line elements throughout.

- ADDED: Introduce url(Location) and url(URL, Label) message line  
elements.

- PORT: Fixed cmake issue for MacOS Homebrew dependencies.

- DOC: edit/0.

- FIXED: thread\_update/2 when no change is made to the target module  
should still wakeup.

- ADDED: prolog\_choice\_attribute/3: `clause` attribute to find the next  
candidate clause.

- FIXED: Initial value for the Prolog flat `on_warning` must be `print`.

- FIXED: Stack trace line-level location when parenthesis are used.

- MODIFIED: write\_term/3 option `brace_terms` behavior was the inverse  
of the documentation. As the docs describe what one would expect and  
is consistent with YAP, the implementation is fixed. We do not expect  
this option to be frequently used. Code using `brace_terms(true)` must  
be updated to use `brace_terms(false)`. If you need to do a runtime  
check to beor conditional compilation compatible with older versions,  
one can use this condition to verify the correct new behavior.

- FIXED: gen\_assoc/3. This patch also removes the ground tests for  
is\_assoc/1 and updates documentation. By Peter Ludemann.

- FIXED: Missing import into library(listing).

- DOC: Added the rbtrees, statistics and fastrw libraries to the main  
documentation to make them available in help/1.

- DOC: Added library(rbtrees) to main documentation to make it work  
in help/1.

- REFACTOR: library(rbtrees) to use more =\> style rules and use det/1.  
This refactoring guards at practically zero overhead cost against  
errors such as passing variable rather than a Red-Black tree, passing  
an invalid Red-Black tree. This patch makes the library strictly  
stead-fast. Finally, many test cases are added.

- ADDED: write\_term/2: option `quote_non_ascii`. This option is enabled  
by default for write\_canonical/1.

- ADDED: PL\_write\_term(): `PL_WRT_QUOTE_NON_ASCII` flag

- FIXED: write\_canonical/1 to use the `brace_terms` option as `false`.

- FIXED: Make write/1 and friends escape characters that the stream  
cannot represent.

- FIXED: write/1 and friends: we must check that the first character  
can be represented by the stream.

- ADDED: Server socket support to SICStus 4 library(sockets) emulation.

- FIXED: If we abort in the tracer from a redo port that is on a foreign  
predicate we must discard this (foreign) frame.

- ADDED: pack\_install/1 to support `pack_version(2).` in `pack.pl`.  
Version 2 changes the names of the exported environment variables that  
control building the pack. This was necessary to avoid conflicts  
with build environments. As an incompatible change was required  
anyway we took the opportunity to rationalise all the variable names.

- ADDED: pack\_install/2: option test(Boolean) to skip the pack tests.

## Package http

- ADDED: Handle new console hyperlink message line items when converting  
error messages to plain text.

- TEST: More debug messages for test\_proxy.pl and avoid reporting  
expected errors.

## Package jpl

- TEST: Disable prolog-in-java test if hamcrest-core is not found  
(broken on Macports)

## Package pengines

- ADDED: Deal with new url message line element.

## Package plunit

- FIXED: Allow include/1 to include tests between begin\_tests/1 and  
end\_tests/1. This patch is incomplete because failing tests are  
reported with the source line of he included file but the file name  
of the main file.

## Package swipl-win

- PORT: Demand Qt 5.15 or 6.

- FIXED: Simplied exit menu, working again, fixed QVariant type()  
usage warnings

## Package xpce

- ENHANCED: Avoid check/0 to report autoload/2 to be redefined.

- ADDED: pceemacs\_client.pl, replacing edit.sh and client.c.

---

<div class="post-metadata">

**Author:** ![kuniaki.mukai](https://avatars.discourse-cdn.com/v4/letter/k/c67d28/32.png) [@kuniaki.mukai](https://swi-prolog.discourse.group/u/kuniaki.mukai)\
**Post date:** [December 21, 2021, 7:58am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-5-4/4786/2 "2021-12-21T07:58:13Z")

</div>

Thank you for preparing environment to build M1 Mac binaries from source.

However, building M1 Mac binaries has failed for version 8.5.4 with a fatal error message on my M1 MacBook Pro Monterey with gcc-11. I have switched back to the default script to use clang. I lost the error log, but it is reproducible.

---

<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:** [December 21, 2021, 9:34am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-5-4/4786/3 "2021-12-21T09:34:44Z")

</div>

I said the gcc-11 build is broken. With some hacks you get a compiled version but it fails on various tests for what seems to be C type conversion issues. We’ll wait for gcc to mature for the M1. The good news is the Clang 13 reduced the performance gap to GCC considerably (at least on the M1) and the M1 Mac with Clang is a lot faster than the Intel Mac with GCC (at least, when I compare my two Macbook Air models).
