The VikiD Truth

Knowledge base / Computing / Lisp family

picos

Penti

PicoLisp

If you have always been interested in Lisp and its variants, such as Common Lisp, Scheme, Racket or newLISP, I think you are really going to love PicoLisp.

Here is the truth about PicoLisp: it is a Lisp that removed nearly everything other Lisps added, and found it lost almost nothing. It is an interpreter on purpose, with one data structure, dynamic binding and a built-in database. And it is very much alive: as I write this (October 2026) the current release is 26.9, and Alexander Burger still ships a new one every quarter.

Where PicoLisp is in 2026

When I first wrote these notes (2016–17) there were two implementations: the original 32-bit one written in C (pil32), and a 64-bit one written in a generic assembler that was itself written in PicoLisp (pil64). Both are history now.

The current PicoLisp is pil21:

I no longer use PicoLisp every day, but I still think it is one of the best ways to really understand how a Lisp works.

What it is, in plain words

It has exactly three kinds of data:

  1. Numbers: arbitrary-precision integers. There are no floats; you use fixed-point with a scale (*Scl), which is honest about decimals. See Working With Numbers.
  2. Symbols: names with a value and a property list. They can be internal (foo), transient ("strings"), or external ({A1}, objects that live in the database).
  3. Lists: chains of two-slot cells. See Find Boxes in Lists.

On top of that sit a built-in object system, a built-in database with entities and relations, Pilog (a Prolog inside Lisp), and libraries for HTTP, HTML forms, JSON, SVG and now LLM APIs. A full web application with persistence fits in a few hundred lines.

Why it matters

An everyday analogy: a Swiss army knife versus a toolbox

Common Lisp is a full workshop toolbox, with hundreds of specialised tools, each perfect for something. PicoLisp is a really good Swiss army knife. It has fewer blades, but they all fold out of the same handle, and you always have it in your pocket.

A hands-on taste

Tested on PicoLisp 26.9:

$ pil +
: (version)
26.9.25
-> (26 9 25)
: (de fact (N) (if (=0 N) 1 (* N (fact (dec N)))))
-> fact
: (fact 30)
-> 265252859812191058636308480000000
: (mapcar '((X) (* X X)) (range 1 5))
-> (1 4 9 16 25)
: (scl 2) (format (*/ 1.25 3.0 1.0) *Scl)    # fixed-point: 3 x 1.25
-> "3.75"
: (pp 'fact)                                # code is data
(de fact (N)
   (if (=0 N)
      1
      (* N (fact (dec N))) ) )

A tiny class, using the built-in object system:

(class +Pt)
(dm T (X Y) (=: x X) (=: y Y))
(dm len> () (sqrt (+ (* (: x) (: x)) (* (: y) (: y)))))
(len> (new '(+Pt) 3 4))   # -> 5

Getting it

See PicoLisp Installation for the full INSTALL text. In short, build from source:

sudo apt install binutils make clang llvm libreadline-dev libffi-dev libssl-dev pkg-config
wget https://software-lab.de/pil21.tgz && tar xfz pil21.tgz
cd pil21/src && make && cd ..
./pil +          # REPL with debugging on

Many distributions package it (apt install picolisp on Debian/Ubuntu, Alpine, Arch AUR, FreeBSD ports, Termux, Guix, Nix), but versions lag behind, often by a year or more. Void Linux and Homebrew have no package, so build from source there.

Common misconceptions

Connections

Last edited · 51 revisions

Tags: #Computing