GitHub - SWI-Prolog/tinker: SWI-Tinker: a browser playground for SWI-Prolog (original) (raw)

SWI-Tinker: SWI-Prolog in your browser

Public demo at https://wasm.swi-prolog.org/wasm/tinker

This repository implements SWI-Tinker, a SWI-Prolog playground running in your browser based on SWI-Prolog compiled usingEmscripten toWASM.

The current system is primarily a proof-of-concept. You are encouraged to help improving it. The TODO file in this repo gives a list of possible improvements.

Achieved functionality

Limitations and alternatives

SWI-Tinker is over 10 times slower than native SWI-Prolog on the same hardware. SWI-Tinker lacks many libraries bundled with the native version, either for reducing the size or because required primitives are lacking. It also lacks important features of SWI-Prolog such as_multi threading_ and access to a lot of system resources. To get a list of available and not-available libraries, run

Some alternatives for running Prolog in your browser are:

Acknowledgements

Raivo Laanemets did most of the ground work getting SWI-Prolog to run using WASM. Jesse Wright provides the npm packageswipl-wasm. Torbjörn Lager created the first version of SWISH.