# Wiki Discussion: SWI-Prolog in the browser using WASM

**URL:** <https://swi-prolog.discourse.group/t/wiki-discussion-swi-prolog-in-the-browser-using-wasm/5651>\
**Category:** Wiki Discussion\
**Created:** [August 3, 2022, 8:21pm UTC](https://swi-prolog.discourse.group/t/wiki-discussion-swi-prolog-in-the-browser-using-wasm/5651 "2022-08-03T20:21:56Z")\
**Posts on this page:** 1\
**Showing post:** 91

<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:** [August 19, 2022, 3:35pm UTC](https://swi-prolog.discourse.group/t/wiki-discussion-swi-prolog-in-the-browser-using-wasm/5651/91 "2022-08-19T15:35:23Z")

</div>

> [@josderoo](#):
>
> ```prolog
> :- catch(use_module(library(sha)), _, true).
> :- catch(use_module(library(pcre)), _, true).
> :- catch(use_module(library(http/http_open)), _, true).
> :- catch(use_module(library(semweb/rdf_turtle)), _, true).
> 
> ```

I pushed a starting point to deal with this. After reading all the warning on emscripten against using dynamic linking I decided for another route I had in mind to resolve this issue: allow adding the foreign extensions to the core system. This is now a new option `-DSTATIC_EXTENSIONS` to `cmake` which is enabled by default for Emscripten. This allows building fully static SWI-Prolog executables with extensions, which surely has value on its own 🙂

Currently includes some of the `clib` libraries, the `sgml` library and some of the `http` libraries.

An overall worry is the size of the whole thing ☹

Pushed to #wasm\_demo

---

_[View the full topic](https://swi-prolog.discourse.group/t/wiki-discussion-swi-prolog-in-the-browser-using-wasm/5651)._
