PicoLisp Sources
The plain idea
PicoLisp has been implemented three times. This page is the index of my reading of all three, updated in October 2026:
- pil32, written in C. It is small, readable, and the easiest place to start. Its files (
pico.h,main.c,sym.cand the rest) are listed below as I studied them in 2017. They are kept here as an archive. pil32 is no longer maintained, but its spirit lives on in miniPicoLisp, a minimal C version. - pil64, written in a generic assembly language that was itself defined in PicoLisp, then translated to x86-64, ARM64, PowerPC and others. It was fast and had a full 64-bit object database. It is also archived now (see PicoLisp ASM).
- pil21, the current PicoLisp since 2020 (latest release 26.9). Alexander Burger rewrote the system again, this time in PicoLisp itself, generating LLVM IR. It keeps the same language and libraries (
@lib/*.l) and adds namespaces. If you want to read the code that actually runs today, read this one.
Why read interpreter sources at all?
Because PicoLisp is small enough to read. All of pil21’s src/*.l is about 16,000 lines. You can see exactly how a cell is laid out, how a symbol stores its value and properties, how the garbage collector marks, and how eval walks a list. See The PicoLisp Machine for the data model.
An analogy
Reading a novel tells you the story. Reading the author’s drafts tells you how stories are built. These pages are the drafts.
The pil21 source tree (src/)
From pil21.tgz, version 26.9:
| File | What it holds |
|---|---|
lib/llvm.l | The LLVM front end: a PicoLisp DSL that emits LLVM IR. Everything else is written in it. |
vers.l | The version, (pico~de *Version 26 9 25). See vers.l. |
defs.l, glob.l, dec.l | Constants, global symbols and the symbol table, and declarations. |
main.l | Startup, the REPL, eval/apply, error handling, signals. |
gc.l | The mark-and-sweep garbage collector and heap. |
big.l | Numbers: short numbers and bignums, arithmetic. |
sym.l | Symbols, names, namespaces, properties, list functions. |
io.l | The reader, printer, files, sockets and pipes. |
db.l | External symbols: the database engine. |
apply.l, flow.l, subr.l | Function application, control flow (if, loop, co…), and list built-ins. |
ext.l, ht.l | The ext.so and ht.so extension libraries (ht.so speeds up HTTP and HTML output). |
lib.c, pico.h | A small C helper layer for things easier done in C (terminal, signals, native calls). See pico.h. |
httpGate.c, ssl.c, balance.c, sysdefs.c | Standalone tools in C: the HTTPS proxy (httpGate), the SSL client, a load balancer, and the generator for lib/sysdefs. |
Makefile | Builds it all with clang, opt, llc and llvm-link. See Makefile. |
A built-in function in pil21 looks like this (from src/subr.l):
# (cdr 'lst) -> any
(de _Cdr (Exe)
(chkD (eval (cadr Exe))) )
That is PicoLisp code, but it is compiled, not interpreted: lib/llvm.l turns it into LLVM IR (base.ll), and LLVM optimises it into machine code. The tarball ships the generated .ll files, so you can build pil21 without having PicoLisp installed first.
How to use this page
For today’s PicoLisp, start with src/defs.l and src/glob.l for the data structures, then main.l for evaluation, then sym.l and subr.l. Read the reference VM section alongside.
For the historical C version, start with pico.h, then main.c and flow.c to see evaluation, then sym.c and subr.c for symbols and lists.
Examples Examined
Libraries (current)
32 Bit C Source (pil32, archive)
These are my 2017 reading notes on the pil32 sources, kept as they were:
- pico.h (now also covers pil21’s
pico.h) - main.c
- apply.c
- balance.c
- big.c
- ext.c
- flow.c
- gc.c
- ht.c
- httpGate.c
- io.c
- lat1.c
- Makefile
- mkVers
- net.c
- ssl.c
- start.c
- subr.c
- sym.c
- tab.c
- utf2.c
- vers.h
64 Bit Asm Source (pil64, archive)
- PicoLisp ASM: the pil64 virtual machine and its registers.
