Web Application Programming in PicoLisp

Search for a command to run...

No comments yet. Be the first to comment.
In this series, we will show how to create a basic web application in PicoLisp.
Welcome back to the Web Application tutorial. Today we will discuss how the PicoLisp interpreter actually transforms a script to something the browser can display. In order to understand that, we will need some basic knowledge about the HTTP protocol...
In our previous post, we introduced how to utilize Discrete Event Simulation (DES) in PicoLisp. Now, let's explore another application: a railroad model simulation that includes tracks and trains. The visualization is ASCII-based, so feel free to unl...

The Dining Philosophers

In this post, we will introduce the concept of co-routines and how they are handled in PicoLisp. This will be the foundation for the subsequent posts on Discrete Event Simulation and finally a couple of examples, including an ASCII model railway simu...

One of the many nice things of PicoLisp is that it comes with a built-in database. This makes it easy to collect and store our own data, for example via a mobile app. But not all data is best represented in tables and lists: sometimes a colorful litt...

In the last two posts, we have built a little app that shows the current location and displays the nearest ice cream shops: https://picolisp-explored.com/an-openstreetmap-app-written-in-picolisp-pt-1 https://picolisp-explored.com/an-openstreetmap-ap...

Up to now, all scripts we have discussed were fairly academic. They are nice to get solid PicoLisp skills, and to get the basics right. Nevertheless, in order to create something practical we need some things more in our toolbox.
This series will fill up some of these gaps by explaining the fundamentals of Web Application Programming in PicoLisp. We will cover how to write basic programs that can be viewed in the web browser.
We will not talk about application programming for mobile devices (maybe at a later point). If you're curious about that, check out the PicoLisp PilBox.
There might be several definitions. In my understanding, the most basic requirement is that the user (client) can access it through the browser, typically via the internet.
The main advantage is that the user does not need a local PicoLisp installation to access the app.
Which components do we need? The typical technology stack of a web application consist of three parts:
The front-end is the part of the program which is displayed in the web browser. Modern browser "speak" HTML, CSS and and also provide a JavaScript runtime-environment. The communication between client and server is handled by the HTTP-protocol or its encrypted counterpart HTTPS.
There is a trend nowadays to handle a lot of the application logic in the front-end, with help of JavaScript frameworks like React, VueJS and so on. The advantage is that it is easier to create a full-responsive design (i. e. design that looks and feels good on smartphone, notebook, large-screen TV). A side-effect is that many of these web apps look kind of the same, because they all use more or less the same modules - which helps to make the user get used to even really weird stuff.

The downside is that these kind of apps are really heavy, and usually useless in a text browser. Some even cannot be viewed properly on older smartphones or with weak internet connection. And since the abstraction level is quite high, the developer usually has no idea what is really happening behind the scenes.
As you might know if you followed the blog up to now, the core of the PicoLisp philosophy is extremely minimalistic. This also applies to the web application.
You can write client, server and the database code purely in PicoLisp. Obviously the browser doesn't understand any PicoLisp at all, therefore the code is rendered server-side and then sent to the client (similar to other scripting languages like for example PHP). Like any other website, you can style the page using custom CSS and use the standard HTML elements. JavaScript is not needed, which can be interesting in environments where JavaScript is disabled due to security reasons.
One of the nice things in PicoLisp is that it is so small and minimalistic that you can understand what is happening (if you want to). Since the whole codebase is free, you can also extend and develop it based on your own needs, and it can be a great opportunity to learn and try out new things.
On the other hand, if you want to create a fancy, fully responsive web app in the shortest time possible, and you don't have any custom requirements for the logic behind, and you're also not curious to work more in PicoLisp, I admit that it might not be the right choice for you. In this case, you might be better off with VueJS or other frameworks that are trending at the moment.
I recommend that you have covered the basics of PicoLisp - for example by reading the "Beginner's Series" - and you should also know the basics of HTML and CSS .
https://picolisp.com/wiki/?web
https://xkcd.com/1174/