
Web Programming in SWI Prolog (2019) - luu
https://www.monolune.com/web-programming-in-swi-prolog/
======
carapace
Also check out Anne Ogborn's tutorial "Creating Web Applications in SWI-
Prolog"
[http://www.pathwayslms.com/swipltuts/html/](http://www.pathwayslms.com/swipltuts/html/)

Following that I made a very simple ("hello world" simple) server that serves
Tau Prolog ( [http://tau-prolog.org/](http://tau-prolog.org/) ) to the client
and establishes a websocket connection between them.

It's here FWIW: [https://git.sr.ht/~sforman/yrad-
nettles](https://git.sr.ht/~sforman/yrad-nettles) (WARNING: it's not meant for
public consumption, I think it might be broken at the moment because I was
experimenting with serving prolog scripts like js scripts when I stopped
working on it... I'm putting it out here in case you want to try to glean some
insight from it. I was looking over it myself just now and I forget a lot
about how it's supposed to work, so read it alongside Anne's tutorial, if at
all. Cheers! Also, I should mention it depends on a whole different project,
an implementation of Joy programming language, to actually do anything,
because it's meant to act as a remote shell/UI for that language hosted in a
Prolog server. So, yeah... you're gonna want to comment that out.)

------
ipnon
While web programming in Prolog has been insightful, I think there are more
expedient areas of application for the language.

Prolog is especially underutilized in databases.

~~~
chekovcodes
This is a database written in Prolog: [https://github.com/terminusdb/terminus-
server](https://github.com/terminusdb/terminus-server) \- albeit with a RUST
storage engine - prolog's lack of types means there are better storage
solutions, but for constraint logic, it's unbeatable.

~~~
ipnon
A statically typed logic language would be ideal for both

~~~
Avshalom
[https://mercurylang.org/](https://mercurylang.org/)

~~~
lliamander
Mercury is cool. I translated a simple Prolog program to it once, and it was a
head trip. Hard to get my mind around, but also helped me see the connection
between functions and relations.

------
simplify
Learning web Prolog is my current programming side project. My ultimate goal
is to create an online board gaming platform, as writing board game rules in
Prolog has turned out to be a smooth and pleasant experience :)

Not to mention, SWI Prolog already has http, websockets, rpcs, and pubsub
built in, so there isn't really a need to download any external libraries.

------
jakearmitage
What could be good uses of a prolog-based web service? Calendar availability?
Scheduling appointments? Issue diagnosis?

~~~
bawolff
It's a turing complete language... so anything you want!

