Standard library

PXX ships its own runtime (RTL) and component library (PCL), written from scratch with FPC-style naming. This section documents the units a program can uses.

The pxx wrapper created by install.sh adds the bundled library roots, so most programs can use these units without passing extra -Fu flags.

Core units

Unit Area
sysutils Standard utilities, including string conversions, formatting, file paths, and memory helpers.
classes & streams Object, list, and stream infrastructure (lists, string lists, memory streams) for FPC-style code.
textfile Pascal file I/O — text files (Text, WriteLn, ReadLn) and record files (file of T, Seek, FileSize), including the standard Input/Output files, Flush, and Erase.
strings Classic NUL-terminated PChar routines (StrLen, StrPos, StrComp, …).
strutils 26 of FPC's StrUtils routines.
dateutils 7 of FPC's DateUtils routines.
collections A small generic list, TList<T>.
contnrs FPC's TFPObjectList and TFPHashObjectList.
regex Regular expressions with Python's syntax.
math Numeric helpers.
ucomplex Complex numbers with the FPC ucomplex API and operator overloads.
vecmath 2/3/4-component vectors and matrices (TVec3, TMat4, …) with operator overloads.
bignum Arbitrary-precision integers with operator overloads.
typinfo Published properties read and written by name, with FPC's routine names.

Several language features also have runtime support in the default environment: managed strings, dynamic arrays, exceptions, interfaces, classes, RTTI, and file I/O are available without importing a unit just to initialize the runtime.

Common FPC System routines are likewise available with no uses clause, including Move, FillChar, CompareByte, UpCase, Pos, Copy, Insert, Delete, Str, Val, Abs, Sqr, Random, Randomize, RandSeed, HexStr, Lo, Hi, Swap, RunError, and UniqueString. A declaration of the same name in your program shadows the built-in version.

Since pin v449 these also take FPC's other forms: Copy(s, index) (to the end of the string, also with SysUtils in scope), Pos(sub, s, offset), UpCase of a string, and Space(n). Measured 2026-09-28 with v449 (sha256 0ded1e5d04c8), with and without uses SysUtils: Copy('abcdef', 3) is cdef, Pos('b', 'abcabc', 3) is 5 (an offset below 1 or past the end gives 0), UpCase('mixed Case') is MIXED CASE, and Length(Space(258)) is 2, because FPC's parameter is a Byte. FPC 3.2.2 prints the same. With v448 and uses SysUtils, Copy(s, index) and Pos(sub, s, offset) are refused.

Data and formats

Unit Area
json JSON parser / serializer support.
httpjson Fetch and post JSON over HTTP.
base64 Base64 encoding and decoding, for Pascal and Nil Python.
png / image PNG decoding of every non-interlaced colour type and bit depth, and encoding as 8-bit RGBA, plus a simple RGBA bitmap type. No compression library is needed.
zlib Deflate compression and decompression, from Pascal and as Nil Python's zlib module.

Networking and async

Unit Area
http HTTP/1.1 client with redirects, chunked responses, pooling, and TLS backend support.
net / sockets Lower-level networking primitives.
dns, dns_async, dns_libc Host names to IPv4 and IPv6 addresses: PXX's own resolver by default, systemd-resolved or the C library by choice, and a form for coroutines.
scheduler & coroutine Coroutine reactor, cooperative scheduling, and async networking support.
palthreadobj, palparallel OS-level threads (TThread) and the parallel for worker pool.
tls, tls_openssl TLS backend interface and OpenSSL-backed implementation: HTTPS clients and servers.

Crypto and checksums

Unit Area
sha256, sha512, hashing SHA-256, SHA-512, HMAC-SHA256, HKDF, CRC32 and Adler32.
random Seeded xoshiro256** generators and OS entropy.
aesgcm, chacha20poly1305 AES-128-GCM and ChaCha20-Poly1305 authenticated encryption.
x25519, ecdsa_p256, ed25519, rsa, x509 Key agreement, P-256 signing, signature checks, and reading and checking certificates. No side-channel claim: see the page.
tls13_* Native TLS 1.3 handshake/key/record work in progress.

Terminal, UI, and PCL

Unit Area
ansiterm, ansirender, screen, lineedit, menu Terminal UI helpers.
forms, controls, stdctrls, extctrls, comctrls, dialogs, menus PCL: GUI programs in Pascal, Lazarus-style forms and controls over GTK 3.
graphics, glarea, gtk3, gtk3widgets Cairo drawing and an OpenGL area for PCL forms; the GTK 3 binding and widgetset underneath.
tkinter GUI programs in Nil Python, over the system's Tcl/Tk 8.6.

Python modules for Nil Python

Some units are written to be a Python module of the same name, and a .npy program reaches them with import. The ones below have entries of their own.

Module Area
atexit Functions to run when the program ends.
configparser INI settings files.
pathlib Paths as objects.
urllib.parse Splitting and quoting URLs.
sqlite3 SQLite through Python's DB-API.
tempfile Temporary files and directories.
zlib Deflate, crc32 and adler32.
base64 b64encode and b64decode.
re Regular expressions.
random Random numbers, not CPython's sequence.
collections Counter and deque.
html escape and unescape.
markdown A subset of Markdown to HTML.
subprocess Running other programs.

The rest are listed under Nil Python: Shims.

Platform units

The wrapper installs the POSIX platform backend by default. Cross and embedded flows may pass an explicit platform root when a helper asks for it, for example an ESP backend path in an ESP32 object build.

Unit Description
System units signals (Unix signal handlers), syncobjs (TCriticalSection), dynlibs (loading a .so at run time) and bitset (a bit array), with FPC's names.
ESP32 peripherals espgpio, espuart, espadc, esppwm, espi2c, espspi, espnvs, esptimer, espsys and interrupts: pins, serial, analog input, PWM, I2C, SPI, stored settings and timers on the ESP32, from Pascal and Nil Python.
MicroPython code on pxx machine (Pin, I2C, SPI, RTC), framebuf, micropython.const and MicroPython's time names on the ESP32, so published MicroPython drivers compile unchanged; how to fetch and measure real drivers.

For project-local units, pass additional roots with -Fu:

./pxx -Fusrc app.pas app

Status

The library is still young. Treat these pages as the user-facing map of what is intended to be usable from applications; if a documented call fails on the pinned compiler, that is either a docs bug or a compiler/library regression worth filing as a progress ticket.