The VikiD Truth

Knowledge base / Computing / Networking & the web

Application Development

Here is the truth about building applications in PicoLisp: there is no framework to learn on top of the language. The web server, the HTML generator, the form library and the database are all part of the same small system, written in the same Lisp you are writing. An application is a few functions that print a page, plus a database model. That is it.

What it is, in plain words

PicoLisp applications are web applications. You open them in a browser, but the logic lives on the server, in Lisp:

The unusual and clever part is sessions. When a browser connects, the server forks a child process for that user, and the child gets its own port. Everything the user does from then on is handled by “their” process, which keeps all the state in ordinary Lisp variables. No session tables, no serialising state into cookies. When the user goes idle, the process times out and exits.

sequenceDiagram
  participant B as Browser
  participant S as pil server :8088
  participant C as forked child :57881
  B->>S: GET /
  S->>C: fork, pass connection
  C-->>B: page (base href = :57881)
  B->>C: form posts, clicks
  C-->>B: updated page
  Note over C: exits after timeout

Why it matters

An everyday analogy: a personal waiter for every guest

A typical web framework is a canteen: one counter, a numbered ticket for every customer, and the staff look up your ticket each time you come back. PicoLisp gives every guest a personal waiter at their own table. The waiter remembers your order without a ticket. When you leave, the waiter goes home.

A hands-on example: a working form in 20 lines

# hello.l
(allowed ()
   "!work" "@lib.css" )

(load "@lib/http.l" "@lib/xhtml.l" "@lib/form.l")

(de work ()
   (app)                                  # start a session (fork)
   (action
      (html 0 "Hello" "@lib.css" NIL
         (<h2> NIL "Who are you?")
         (form NIL
            (gui 'nm '(+TextField) 20 "Name")
            (gui '(+Button) "Greet"
               '(alert NIL "Hello, " (val> (: home nm)) "!") ) ) ) ) )

(de go ()
   (server 8088 "!work") )
pil hello.l -go -wait        # then open http://localhost:8088

Look at the page source in your browser and you will see the <base href> pointing to a new port. That is your forked session process. allowed is a whitelist of URLs the server may serve, a simple security default. Add + (pil hello.l + -go -wait) to get debug mode and a REPL in the terminal while the app runs.

From here the official tutorial (linked below) adds a database model with class, rel and +Ref indexes, search dialogs and charts. The Health Application tutorial on the PicoLisp site shows a complete app.

Common misconceptions

Practices that survive fashion

Connections

The official tutorial

The main tutorial can be found here. Please read through this document before proceeding with the underlying material.

Applications in Picolisp are essentially Web Apps. The main interface is through browser and each instance of the running app is stored as a session in the browser.

Within the underlying picolisp process, each instance is actually a forked process which is linked with the browser session.

All examples on this page tested on PicoLisp 26.9, October 2026.

Last edited · 4 revisions

Tags: #Computing