5 ms·
Web Programming in SWI Prolog (2019)
- carapace 7y agoAlso 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.)
- jakearmitage 7y agoWhat could be good uses of a prolog-based web service? Calendar availability? Scheduling appointments? Issue diagnosis?
- ipnon 7y agoWhile 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.
- segmondy 7y agoProlog is already a database, why bring in the mess of an external DB. I have used Prolog and ODBC to access a postgres DB. I found it better to just export the data and turn it into a Prolog DB then process my rules than have it run all those logic across the wire.
- The_rationalist 7y agoWhat about performance?
- chekovcodes 7y agoThis 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 7y agoA statically typed logic language would be ideal for both
- Avshalom 7y agohttps://mercurylang.org/ https://mercurylang.org/
- lliamander 7y agoMercury 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 7y agoLearning 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.