# Quick check: Is the swiplwebtut still good for learning server setup?

**URL:** <https://swi-prolog.discourse.group/t/quick-check-is-the-swiplwebtut-still-good-for-learning-server-setup/7372>\
**Category:** General\
**Created:** [April 13, 2024, 6:03pm UTC](https://swi-prolog.discourse.group/t/quick-check-is-the-swiplwebtut-still-good-for-learning-server-setup/7372 "2024-04-13T18:03:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![emummel20](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/emummel20/32/4952_2.png) [@emummel20](https://swi-prolog.discourse.group/u/emummel20)\
**Post date:** [April 13, 2024, 6:03pm UTC](https://swi-prolog.discourse.group/t/quick-check-is-the-swiplwebtut-still-good-for-learning-server-setup/7372/1 "2024-04-13T18:03:21Z")

</div>

Hi quick question: I see the [swiplwebtut](https://github.com/Anniepoo/swiplwebtut/tree/master) “[Tutorial — Creating Web Applications in SWI-Prolog](https://github.com/Anniepoo/swiplwebtut/blob/07b42b1e7eac000d9eeac959ba2a38a616fd4b9b/web.adoc)” was last updated 3 years ago. Is it still pretty much comprehensive to go through and learn how to set up an swi server? Does it pretty much cover most everything needed? Anything missing or any significant changes from the last 3 years?

Thanks.

---

<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:** [April 13, 2024, 6:21pm UTC](https://swi-prolog.discourse.group/t/quick-check-is-the-swiplwebtut-still-good-for-learning-server-setup/7372/2 "2024-04-13T18:21:48Z")

</div>

The overall idea is pretty much ok still. Some libraries have evolved a little. The most obvious changes are in managing websites. Generations a lot of HTML on the server is getting less popular. Many applications are Javascript based and run JSON requests on the server. SWI-Prolog can do that quite well. The stress of the web trutorial is more on generating HTML though.

---

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [April 13, 2024, 6:23pm UTC](https://swi-prolog.discourse.group/t/quick-check-is-the-swiplwebtut-still-good-for-learning-server-setup/7372/3 "2024-04-13T18:23:47Z")

</div>

My attempt to update it is here:

> **[GitHub - kamahen/swipl-server-js-client: Sample SWI-Prolog server with...](https://github.com/kamahen/swipl-server-js-client)**
>
> Sample SWI-Prolog server with JavaScript client. Contribute to kamahen/swipl-server-js-client development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![jamesnvc](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jamesnvc/32/14_2.png) [@jamesnvc](https://swi-prolog.discourse.group/u/jamesnvc)\
**Post date:** [April 13, 2024, 11:15pm UTC](https://swi-prolog.discourse.group/t/quick-check-is-the-swiplwebtut-still-good-for-learning-server-setup/7372/4 "2024-04-13T23:15:15Z")

</div>

> [@jan](#):
>
> Generations a lot of HTML on the server is getting less popular. Many applications are Javascript based and run JSON requests on the server.

There is (fortunately for the tutorial?) kind of a movement back towards generating server-side HTML and “patching” updates on the client (see Hotwire, HTMX). I’ve written some little things in Prolog using this approach.

---

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [April 14, 2024, 1:32am UTC](https://swi-prolog.discourse.group/t/quick-check-is-the-swiplwebtut-still-good-for-learning-server-setup/7372/5 "2024-04-14T01:32:58Z")

</div>

FWIW, the “tutorial” code that I wrote has a static HTML file (`static/simple_client.html`) with an `id=` for each path that will be filled in dynamically. The function `displayQueryResult()` (in `static/simple_client.js`) is a callback that gets the server’s result in JSON and uses the JSON to fill in the HTML. (The code would probably be a bit simpler if SWI-Prolog’s HTML write library were available on the client, but that would require rewriting my JavaScript code into Prolog, something I might do one of these days. Or, the HTML could be generated in the server and sent as a string; but I prefer to separate front-end and back-end representations.)

A more complete example is in [pykythe/browser at master · kamahen/pykythe · GitHub](https://github.com/kamahen/pykythe/tree/master/browser) … it uses the same structure as my “tutorial” code but has a more complex browser layout (drop-downs, resizable panes) and more query types (they all use the same `fetchFromServer()` function with an asynchronous callback).

---

<div class="post-metadata">

**Author:** ![emummel20](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/emummel20/32/4952_2.png) [@emummel20](https://swi-prolog.discourse.group/u/emummel20)\
**Post date:** [April 15, 2024, 3:07pm UTC](https://swi-prolog.discourse.group/t/quick-check-is-the-swiplwebtut-still-good-for-learning-server-setup/7372/6 "2024-04-15T15:07:08Z")

</div>

Haha awesome. Gonna do some [light reading](https://hotwired.dev/) about that. I’m gonna go ahead and believe prolog is simply more cutting edge than the status quo, rather than outdated or less popular.

---

<div class="post-metadata">

**Author:** ![jamesnvc](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jamesnvc/32/14_2.png) [@jamesnvc](https://swi-prolog.discourse.group/u/jamesnvc)\
**Post date:** [April 15, 2024, 7:51pm UTC](https://swi-prolog.discourse.group/t/quick-check-is-the-swiplwebtut-still-good-for-learning-server-setup/7372/7 "2024-04-15T19:51:37Z")

</div>

[Here’s an example](https://git.sr.ht/~jamesnvc/wordle_assistant_pl) of my version of that idea from a couple years ago.
