The proposals in the book manuscript are accompanied by executable proof-of-concept implementations. These serve complementary purposes: the Trinity demonstrator makes the ideas accessible through tutorials and interactive examples; the node implementations explore their realization in different Prolog systems; and the simple nodes expose the core mechanisms in code small enough to study alongside the book.
A separate Trinity conformance suite tests observable behaviour through public interfaces. Its current coverage matrix records selected language and protocol checks, interoperability results, and remaining differences across native SWI-Prolog, Trealla Prolog, GNU Prolog and the browser runtimes. The recorded results are encouraging: all selected required and supporting checks in the consolidated matrix pass for their tested configurations. SWI-Prolog and Trealla exchange actor messages and run remote queries in both directions; the selected HTTP query, paging and promise tests also pass in every direction between SWI-Prolog, Trealla and GNU Prolog. Separate diagnostics and experimental text checks still expose differences. These results describe specific tested revisions and facilities, rather than complete language conformance or production readiness.
The implementations also make the proposals tangible through executable examples. The SWI-Prolog and Trealla nodes run shared tutorial and code examples, including distributed interactions between them, while the browser runtimes provide another way to explore the actor language. GNU Prolog and Ciao support query examples within their narrower scope. Coverage therefore varies with each implementation's facilities; Ciao has not yet been included in the shared conformance matrix.
The implementation work has been done in cooperation with several AIs.
Getting started: See Installing and connecting Web Prolog components for the available combinations of native nodes, browser nodes and user interfaces, local installation instructions, and guidance on building your own UI with AI assistance.
The Trinity demonstrator is the interactive companion to the book. Readers can run queries against live nodes, spawn actors, explore statecharts and make remote procedure calls between nodes. Tutorials, examples and a shared language manual connect these experiments to the book's proposals.
The demonstrator brings together the browser interface and integration with browser-based and native nodes. Its native SWI-Prolog node and SWI-WASM browser runtime are now maintained in separate repositories, described below. This separation allows the demonstrator and the node implementations to develop independently while sharing the same language and protocols.
The hosted demonstrator has best-effort availability and may occasionally be unreachable.
The node implementations explore how different Prolog systems can expose common query and actor interfaces, both in native processes and in the browser. Their scope varies: SWI-Prolog, Trealla and SWI-WASM support actors, while GNU Prolog targets ISOBASE and the Ciao Prolog prototype concentrates on paged queries over a resident database. The conformance suite compares the facilities each implementation supports.
The SWI-Prolog node is the most developed implementation and the principal implementation supporting the book. Extracted from the Trinity demonstrator, it can now be loaded and tested as a standalone package.
Its layers provide local actors, selective receive, links and monitors, private source contexts, resumable toplevels, generic servers, supervisors, statecharts and parallel execution. HTTP supports remote queries, promises and yield; WebSocket connections support distributed actor operations. The node layer adds public profiles, authentication, execution policies and resource controls. Individual lower layers can also be used independently.
The SWI-WASM browser node runs Web Prolog in the browser using SWI-Prolog compiled to WebAssembly. It supports actors, private query sessions, paging, monitors and statecharts, together with HTTP remote queries and WebSocket communication with native nodes.
Extracted from the Trinity demonstrator, the runtime can now be packaged, tested and used independently. Its primary execution model places actors in Web Workers; an alternative main-thread model provides access to the browser's document. Local execution requires no running Prolog server, while distributed examples connect to remote peers.
Try Trinity Studio in your browser: an experimental IDE-style interface with a source editor, resizable workspace, example programs, paged queries and separate answer and output views. It uses the SWI-WASM node locally in your browser and needs no installation, account or running Prolog server. Use “Save source” to keep your work before reloading or closing the page. The Studio source and local setup instructions are also available.
Try Trinity SXML Studio in your browser: draw, edit and run the book’s SXML statecharts. The diagram and source editor stay in step: add states and transitions graphically, edit their properties in the inspector, or work directly in the SXML source. Run a chart to watch its active states and fired transitions, send events and try Prolog queries. Seventeen examples cover features including parallel states, history, deferred events and nested statecharts. The editor and SWI-WASM interpreter run locally in your browser, with no installation, account or running Prolog server required. Use “Save source” to keep edits before reloading or closing the page; drawings can also be exported as SVG. Source and local setup instructions are available.
Visit The Box Shop.
Speak to choose a colour and a size. A voice adaptation of
boxshop-2.xml asks the questions and confirms the order.
Statechart, Grammar and Logger tabs show how the conversation works.
The demo requires a microphone and browser speech support.
Source and setup instructions
are available.
Try The Genealogist (Worker actor):
explore a family diagram, ask Prolog queries and add or remove relationships.
This separate UI experiment uses the SWI-WASM node and needs no installation,
account or running Prolog server. Each page has its own family database;
use “Save Prolog” to keep changes before reloading or closing it.
Compare it with the same demo using
Main thread + DOM, where Prolog draws the
diagram and handles the controls directly through library(dom).
Both versions share the family program, appearance and runtime.
The experiment’s source and local setup instructions
are also available.
Code size. The formatted Worker actor UI spans 481 lines of JavaScript. The Prolog-driven UI spans 144 lines of JavaScript and 595 lines of Prolog: 739 lines in total. Counts include comments and blank lines, and exclude the shared runtime, family rules, HTML and CSS. They depend on formatting and are not a complexity score.
Maintainability. The worker version is smaller and separates the web interface from the Prolog engine. The main-thread version keeps facts, validation calls, answer formatting and DOM events together, which may be clearer for a Prolog-focused maintainer. Both use the same session API; the runtime handles paging, input, interruption and cleanup.
Responsiveness. Both handle ordinary family queries well. Main-thread queries yield cooperatively during Prolog computation, but a call that cannot yield can freeze the interface. The worker keeps Prolog computation off the UI thread and supports hard Abort. Direct DOM access therefore trades some isolation for closer integration with the page.
The Trealla implementation began as a port of the simple SWI-Prolog node and has grown into an independent ACTOR-capable node. Alongside actors, private source contexts and resumable toplevels, it now implements generic servers, supervisors, parallel execution and SXML statecharts.
HTTP provides remote queries, promises and yield, while persistent WebSocket connections support remote actor creation, messaging and toplevel control. Shared conformance tests exercise selected behaviour and interoperability with SWI-Prolog. Authentication, policy enforcement and resource governance are included, although runtime differences and deployment limitations remain documented work.
The GNU Prolog implementation targets ISOBASE, with ISOTOPE a possible later extension. A small C HTTP server supports submitted source, a shared database, JSON bindings, Prolog-text answers and paged query execution. HTTP(S) clients provide remote procedure calls, promises and yield.
Each active query runs in a separate operating-system process, preserving bindings and choice points between pages. Supervisors manage deadlines, resource bounds and cleanup. This design accommodates GNU Prolog's query interface and lack of general heap garbage collection. Selected HTTP interoperability tests include SWI-Prolog and Trealla; broader conformance, compatibility and isolation work remains open.
The Ciao prototype explores a smaller part of the node interface: an HTTP endpoint that evaluates queries over a static, node-resident database and returns paged Prolog-text answers. Ciao engines preserve suspended computations between requests.
Queries execute through a database module using Ciao's pure package, restricting the predicates available to submitted goals. This provides a useful boundary but does not bound execution time or memory use. The prototype does not currently provide actors or JSON answers, and complete ISOBASE conformance has not been established.
The book's implementation appendix develops small nodes to explain the mechanisms behind the larger implementations. The runnable simple-node repository accompanies this presentation with local actors, resumable toplevel processes, an HTTP endpoint with continuation caching, and an RPC client.
The emphasis is on readable code and experiments that readers can reproduce. Regression tests cover actor behaviour, HTTP paging, term transfer and cleanup under interruption; companion checks also exercise the appendix listings.
These teaching implementations run trusted local code. Actors share the host database, and the examples omit authentication, sandboxing, private actor databases and distributed actor transport. They provide a starting point for understanding the mechanisms and exploring ports to other Prolog systems.