Although Prolog is not often associated with web application development, it provides several libraries that make it an excellent tool for creating web applications. Using Prolog, you can deploy a basic server and create dynamic data-driven websites with forms, sessions, authentication, and more.
For these tutorials, I will be focusing on PWP (Prolog Well Formed Pages). This method of server-side scripting that makes it possible to create Prolog-driven webpages using valid well-formed XML. It allows you to create templates using HTML, with just a few added attributes. This approach does not support mixing Prolog and PWP within the same file, and encourages creators to keep their presentation layer separated from logic and data.
Before getting started with creating Prolog-driven websites, you will need to install SWI-Prolog (from source to have access to the required libraries). There are different ways to accomplish this, depending on your environment. The SWI-Prolog website has some documentation on how to build Prolog from source on several different platforms. You can also set up Prolog on a Raspberry Pi.
- Prolog on a Raspberry Pi
- Quick & Dirty Intro to Prolog
- Starting a Server
- Handling Assets
- Displaying Lists – Coming Soon
- Bootstrap Example – Coming Soon
- Creating a Template – Coming Soon
- Bonus: Hosting a SWI-Prolog site on Cloud9 – Coming Soon
More Coming Soon…
Checkout the Code
Example code for all tutorials is available on Github here.