Ann: SWI-Prolog 8.5.1

Dear SWI-Prolog user,

SWI-Prolog 8.5.1 is ready for download. Quite a few things happened. The
8.4.0 stable always raises some portability issues when packagers start
testing it :slight_smile: Other highlights:

  • Thread signal interfaces have been refined as discussed here.

  • The new argv_options/3,4 functionality ready for serious use.
    Most likely small things will still change. I do not expect
    serious changes. Thanks to the comments from @swi and
    @peter.ludemann.

  • There is a start for proper internationalization, both for
    Prolog itself and for (especially CLI) applications.

  • The shutdown procedure has been improved by avoiding the need
    for polling when waiting for threads do die. This typically
    makes shutdown 0.1 second faster, which is pretty useful for
    short running CLI applications. A minimal saved program now
    completes in 28ms on my dev machine (AMD3950X, ssd, Ubuntu 20.04).
    It is surely possible to reduce that a lot further. That would
    ask for a different design where procedures are translated from
    the disk format to the memory format on demand.

    Enjoy — Jan

SWI-Prolog Changelog since version 8.5.0

  • PORT: Alignment on ppc64el. Better version than
    df1f0bf795a16edd313a2a25f0678ce044a4a71d

  • ADDED: argv_options/3: allow including longer descriptions as header,
    usage and footer in the usage message.

  • ADDED: argv_options/3: Allow the user to redefine the bindings for
    help. Suggested by @swi.

  • PORT: Alignment on ppc64el (Debian). See
    ppc64le compilation failure in Alpine for swi-prolog 8.5.0 · Issue #104 · SWI-Prolog/issues · GitHub

  • FIXED: pl_get_uint64() for GMP numbers on 32-bit systems.

  • ADDED: argv_options/3,4: allow for disjunctive types.

  • ADDED: library(prolog_versions) to simplify demanding minimal version
    and features of the hosting Prolog system.

  • ADDED: argv_options/4: options_after_arguments(false) option to
    stop processing options after the first positional argument.

  • FIXED: Re-enable prolog:message//1 hook for print_message/2.

  • ADDED: print_message/2: language detection for Windows for message
    generation.

  • ADDED: win_get_user_preferred_ui_languages/2 to get access to the
    user’s preferred UI languages on Windows.

  • INSTALL: Windows: avoid confusing uninstall version message.

  • ADDED: user:message_property/2: tag(Tag) property to change ERROR
    and/or Warning.

  • ADDED: print_message/2: Allow message term to text translation to be
    language specific.

  • ENHANCED: Allow loading library(prolog_debug) if spy and/or nospy
    are defined as operators.

  • FIXED: Do not reclaim memory on termination when we failed to terminate
    all threads.

  • ENHANCED: Provide a non-polling process termination procedure for
    systems that do not have sem_timedwait() such as MacOS.

  • ENHANCED: Improve performance for process shutdown on POSIX
    systems that support sem_timedwait() by avoiding a polling loop.
    This typically saves 0.1 second on the elapsed time for short lived
    executables.

  • ADDED: Allow --no-pce together with -c (compile) to produce
    a state that does not include xpce.

  • FIXED: Retract for retract((a:-true)). Reported by Fernando
    Sáenz-Pérez.

  • ADDED: argv_options/3: type term

  • ADDED: argv_options/3 to provide a full featured and lightweight
    alternative to library(optparse).

  • FIXED: format/2 and friends: verify error when emitting rubber.

  • ADDED: format/2 and friends: support ~:|, the colon modifier for
    tab stops to insert a newline if the current column already passed
    the tab stop.

  • FIXED: Fixup singleton for cleanup of optspec validation.

  • FIXED: Issue#896: Claim that memory streams as used by
    e.g. open_string/2 are reported as repositionable. Reported by
    Matthijs van Otterdijk.

  • ENHANCED: Allow 64-bit seek function to work on memory streams.

  • ADDED: Allow stream contol functions to return whether the stream
    is repositionable.

  • FIXED: Make optparse:parse_type/3 hook work. Cleanup of optspec
    validation.

  • MODIFIED: opt_parse/4: if an option is unknown only throw an exception,
    i.e., not first print the help message.

  • ADDED: opt_parse/4: Allow using a string as help(Help) value.

  • FIXED: det/1: avoid false non-determinism claim if all relevant
    choicepoints are debug choicepoints.

  • ENHANCED: library(rbtrees): error checks and more test cases.

  • FIXED: Predicate access in nested transactions for clauses that are
    removed in the parent (or a previous nested) transaction. We must
    inspect the affected clauses of all parent transactions. Reported by
    Eric Zinda.

  • FIXED: Answer subsumption tabling case provided by Annie Liu.

  • TEST: Tests for new thread_signal/2.

  • ADDED: Predicate property sig_atomic. Currently only for the
    built-in sig_atomic/1.

  • DOC: Document new thread signal primitives.

  • ADDED: thread signal blocking and unblocking.

  • FIXED: Delay signals in prolog_exception_hook/4.

  • MODIFIED: Signal handling no longer backtracks. This implies it may
    set global variables.

  • ADDED: sig_pending/1 and sig_remove/2.

  • ADDED: sig_atomic/1 to run goals protected from signals. This
    predicate used to be available as the undocumented ‘$sig_atomic’/1.
    ‘$sig_atomic’/1 is now available from library(backcomp).

  • ENHANCED: thread_signal/2: reduce the locked section

  • FIXED: thread_wait/2: return when condition is true before this
    predicate is called.

  • FIXED: thread_wait/2: wait_preds option accepted non-predicate
    indicators.

  • ADDED: sandbox: call_delays/2 as safe meta predicate

  • FIXED: Issue#889: swipl --abi-version crashed.

  • ENHANCED: trace/2 to delete that we are tracing this predicate if
    the port list is empty.

Package http

  • ADDED: JSON writer for dicts now have a hook json_dict_pairs/2 that
    allows the user to select keys from the dict and particularly define
    the order of keys in the resulting JSON.

  • ADDED: http_read_data/4: handle the input_encoding/1 option when
    using to(Type).

  • FIXED: range streams: be careful about race conditions when
    asynchronously finding all streams that refer to OS file handles.

Package mqi

  • ENHANCED: Use new controlled options and automatic help.

  • ENHANCED: Include dependencies to make mqi run with disabled
    autoloading.

  • FIXED: Use argv rather than os_argv. Breaks on new argv_options/3.

Package odbc

  • TEST: Include ODBC tests based on the environment variable
    SWIPL_TEST_ODBC_DRIVER. Also fixes cleanup of the ODBC tests.

  • FIXED: Ensure statement is closed in two scenarios.

Package pengines

  • ENHANCED: Provide CSS style wfs_undefined for undefined answers.

  • ADDED: term_html:portray//2 hook that plays a role similar to portray/1
    for HTML rendering of terms.

Package protobufs

  • FIXED: uint32_codes/2 in mode (-,+) on may return a negative value
    on 32-bit systems.

Package sgml

  • FIXED: xml_quote_cdata/3: possible race condition if two threads use
    this for the first time.

Package xpce

  • FIXED: Do not setup search path for library(pce) if --no-pce
    is given.
2 Likes

Hello, I have a problem with Swi-Prolog 8.5.11 for x86_64 - Arch Linux.

$ swipl example.pl           
ERROR: /usr/lib/swipl/swipl.rc:136: Initialization goal raised exception:
ERROR: source_sink `library(swi_hooks)' does not exist

How can I fix this?

I have little clue. library(swi_hooks) is part of the xpce extension, but so is swipl.rc. Looks like a broken installation, possibly a mixture of new installation and parts from an older installation. If this is a standard Arch Linux package you may want to raise a but report there.