\chapter{Using SWI-Prolog in your browser (WASM)} \label{sec:wasm} The SWI-Prolog WebAssembly (WASM) port lets you run SWI-Prolog directly in your browser. This is a fairly comprehensive version of SWI-Prolog that supports the core system as well as a good selection of \jargon{packages}, including many of the \jargon{foreign packages}. The WASM port uses \href{https://emscripten.org/}{Emscripten} to compile the SWI-Prolog source code to WASM, which runs on a virtual machine that is provided by almost all modern browsers. To build the SWI-Prolog WASM port, see the building instructions on \href{https://swi-prolog.discourse.group/t/swi-prolog-in-the-browser-using-wasm/5650}{the wiki page} \section{Loading and initializing Prolog} \label{sec:wasm-loading} The WASM SWI-Prolog distribution consists of three files: \begin{description} \item[\file{swipl-web.js}] This is the main file that must be loaded using a \verb$