The full method-level reference for built-in classes and the standard library ships with each release for NDA partners. The page below summarises which classes exist and points to the relevant example files.
Core
Array and String use 1-based indexing per Smalltalk convention for at: / at:put: / indexOf: / copyFrom:to: and related index-bearing methods; at: 1 is the first element.
| Class | Notes |
|---|---|
Integer, Float | Standard arithmetic, factorial, negated, timesRepeat:, to:, to:do:, bit ops, comparisons (min: / max: via Comparable). Integer division by zero raises a catchable error rather than trapping |
Boolean, True, False | ifTrue:, ifFalse:, ifTrue:ifFalse:, and:, or:, not |
String | A sequence of bytes, not of characters — 'あ' size is 3, and at: / copyFrom:to: count bytes, so slicing at an arbitrary offset can cut a character in half. This is what lets text, a socket payload and an encoded blob be one type with no conversion between them. String fromCodes: builds one back from bytes. Slicing, concat:, asUppercase, asLowercase, trimmed, regex match, lines, replaceAll:with:, < |
Char | Character predicates and conversion |
Regex | compile:, then match:, matches:, findAll:, replaceAll:with:, split: (the String regex helpers dispatch through this) |
DateTime | now, parse:, fromMs:, y:m:d:h:min:s: (+ ms:), formattedAs:, isoString, and year … millisecond field accessors (millisecond precision) |
Error | Error raise: to signal, Error try:onError: to catch — the handler receives the message string (no exception-type hierarchy) |
Array | Persistent 32-way trie, with:, at:, at:put:, size, sort:, indexOf:, ,. `Array build: [:add |
Dict | Persistent HAMT, new, from:, at:, at:put:, at:ifAbsent:, at:ifPresent:ifAbsent:, includesKey:, keys, size, associations, and builtin do: / collect: / select: / reject: |
Set | Built on Array |
Maybe | Parameterised absence type, none, some:, ifPresent:ifAbsent:, isPresent |
Block | value, value:, value:value:, ... valueWithArguments:, whileTrue: |
Class | Class meta-operations, reflection |
Object | printNl, print, =, ~=, asString, printOn:, className, isKindOf:, fieldNames, atField:, atField:put:, copyWith: (typed immutable update — field names checked against the class, values against the field types), asObject, perform:, perform:withArgs: |
WriteStream | << dispatching through printOn:, nl, space, tab, position, isEmpty, reset |
Comparable, Enumerable | Protocol-bound mixins. Enumerable is the wider protocol on top of the builtin iteration methods (sum, count:, detect:ifNone:, anySatisfy:, joinWith:, flatCollect:, min / max) |
Actor and Concurrency
| Class | Notes |
|---|---|
Actor | self, spawn:, !, receive, receive:, receive:after:do:, ask:, monitor:, linkTo:, trapExits:. monitor: / linkTo: on an actor that already died report the death instead of dropping the registration; an abnormal death that no monitor and no link can observe is reported on stderr |
Future | await, await:, resolved?, pending?, resolve:, fail:, new (manual construction) |
Down, Exit | Monitor / link failure envelopes carrying actor ref + reason |
Service Layer
| Class | Notes |
|---|---|
HTTP, HttpServer, HttpResponse, HttpRequest | HTTP server takes a block as handler; chunked + keepalive supported. start:handler: / startGraceful:handler: bind every interface, startHost:port:handler: / startGracefulHost:port:handler: bind one local address. HttpRequest >> peerAddress is where the request came from — what a rate limit keyed on the source needs; behind a reverse proxy it is the proxy's address, and whether to believe X-Forwarded-For instead is the application's judgement. HTTP parseMultipart:boundary: → MultipartPart (name / filename / contentType / bytes) for file uploads |
LpHttpClient | HTTP client — get:retries: / get:headers:retries:, post:body:contentType:retries: / post:body:contentType:headers:retries: → HttpResponse. Reaches https:// endpoints, authenticating the peer against the system certificate store. Host, Content-Length, Connection and Content-Type are written by the client and refused from the caller; header names and values are checked, so one built from untrusted input cannot split the request. Once connected it waits at most 30 seconds to be answered (LAMBDA_PRELUDE_HTTP_TIMEOUT_MS to change it), so a server that returns its headers and then stops fails the call rather than holding the calling actor. The RPC path (Remote, grains) speaks http only |
Smtp | the smtp plugin (Plugin load: 'smtp') plus the stdlib Smtp module. Smtp send: conf to: addr subject: sub text: body sends one message to one recipient over plain, STARTTLS or wrapped TLS, authenticating the peer against the system certificate store. The subject goes out as an RFC 2047 encoded word and the body base64-encoded, so a line the sender wrote cannot end the data early. One budget covers the handshake and every read (60 seconds, LAMBDA_PRELUDE_SMTP_TIMEOUT_MS), and the answer (SmtpResult) names the stage a refusal came from, so a wrong password and a rejected sender are told apart |
TCP, TCPSocket, TCPServer | Bounded socket I/O integrated with the actor scheduler. listen: binds every interface, listenHost:port: binds one local address. Hostname resolution runs on a background resolver thread and the connect is non-blocking, so neither a slow DNS server nor a slow handshake freezes the domain |
TLS, TLSSocket | Tls.Engine driven, handshake / read / write park on I/O wait |
UDP, UDPSocket, UDPDatagram | datagram sockets — bind: / bindHost:port:, sendTo:port:data:, receiveFrom / receiveFrom: (bounded; raises when the deadline passes); a received UDPDatagram carries the source host / port for replies |
WebSocket | accept:on:, isUpgrade:, readFrame:, writeText:to:, writeBinary:to:, writePong:to:, writeClose: |
JSON | parse:, serialize: |
JsonRpcServer, JsonRpcClient | JSON-RPC 2.0 dispatch — single, batch, notifications, error envelopes |
Remote | Remote at:for:id: — proxy to a remote class over JSON-RPC; typed against the target class's protocol when built with a literal class (a non-literal for: stays dynamically typed). Connections are reused per host and port instead of dialled per call, and one the peer closed in the meantime is retried once on a fresh connection |
TeriosServer, ServiceDispatcher, Res | TERIOS-style serviceName / requestDto / responseDto / errorInfoList envelopes |
Runtime
| Class | Notes |
|---|---|
File | read:, write:contents:, delete:, exists:, mkdirP:, removeDir: (empty directory), rename:to:, listDir:, isDir:, isFile: |
OS | stdinLine, stdinAll, stdinPasswordLine (suppresses echo on Windows console + POSIX TTYs), hostname, env vars with defaults. flush — printNl ends its line and hands it to the screen, print does neither, so a prompt written with print needs flush before the read that waits on it. Clocks — time is the wall clock for calendar timestamps, monotonic (ms) and timeNs (ns) are monotonic, for measuring durations and periodic phase. Subprocess & watchdog — exec: / exec:input:, fire-and-forget spawn: / spawn:output:, running: liveness probe, kill:, gracefulShutdown: |
Log | Structured logging (info:, warn:, error:, key-value fields) |
Data
| Class | Notes |
|---|---|
DB, DBConnection, DbRow | SQLite (built in) — open:, exec:, exec:params:, query:, query:params:, close. A statement the database refuses — one that will not compile, one whose parameters do not match, one a constraint rejects — is an error the caller catches with Error try:onError:, not something that ends the process, and the connection stays usable afterwards. Each row of a query: is a DbRow: columns read as Maybe[String], and asDict hands the row to code that takes a Dict without rebuilding it |
Postgres, PostgresConnection | PostgreSQL via Dynlink plugin (interpreter / AOT) |
Mariadb, MariadbConnection | MariaDB / MySQL via Dynlink plugin (interpreter / AOT) |
Redis, RedisConnection | Redis / Valkey via Dynlink plugin (RESP2 over scheduler-integrated non-blocking TCP), ping / get: / set:value: / set:value:ex: / del: / incr: / decr: / exists: / expire:seconds: / keys: / auth: / multi / exec / discard / cmd: / close |
TORM | Doma-compatible 2-way SQL templates + DAO / Entity macro DSL (dao: / entity: keywords; a plugin brought in with imports: (Torm)). Dialects: PostgreSQL / MySQL / MariaDB / SQLite. A DAO method's answer follows its name — count* a scalar, exists* a Boolean, insert* / update* / delete* the rows affected, anything else the rows — and a clause entry can say it outright, { file: 'CreateUsers.sql', kind: #exec }, for a statement whose honest name carries no such prefix |
Crypto
| Class | Notes |
|---|---|
Hash | SHA-256, SHA-512, HMAC-SHA-256 (hmacSha256:key:) |
Aes | AES-256-GCM |
Argon2 | Argon2id password KDF (RFC 9106), backed by system libargon2 |
JWT | Sign / verify |
Random | Random hex: — random hex string |
Base64 | encode: / decode: use the standard alphabet with padding, encodeUrl: / decodeUrl: the URL-safe one without it. Decoding refuses input it cannot read rather than answering something wrong |
Operations
| Class | Notes |
|---|---|
LpCache | In-memory cache builtin with size / TTL bounds (start:, at:, at:put:, at:put:ttl:) |
LpChannel | In-process pub/sub. subscribe:do: / publish:message: / subscriberCount |
Supervisor | One-for-one / one-for-all / rest-for-one strategies on top of monitor + spawn |
Metric | Named in-memory counters for service-level instrumentation |
Test | run:do:, assert:, assert:message:, assertEqual:to:, fail:, summary |
Standard Library Modules
These ship as .lp files under stdlib/ and are loaded with module Main imports: (...). The standard library stays intentionally small; the modules below are the full set.
Core protocols
comparable.lp—Comparableprotocol with<-based defaults (>,min:,max:, ...)enumerable.lp— the widerEnumerableprotocol ondo:-based defaults (sum,count:,detect:ifNone:,anySatisfy:,joinWith:,flatCollect:, ...). The core iteration methods are already builtins onArrayandDict; this is what you import for the rest, and for your own classesset.lp— persistentSetbacked byArray,add:/remove:/includes:ordered_dict.lp—Dictvariant that preserves insertion order on iterationassociation.lp— (key, value) pair object; element type ofDict>>associations/Dict>>associationsDo:
Service runtime
http.lp— accept loop and keep-alive aware connection handler on top of theHTTPbuiltinjson_rpc.lp— JSON-RPC 2.0 server and client over HTTP (single / batch / notification / error)lp_server.lp— one-line exposure of an LP service as a JSON-RPC 2.0 endpointsse.lp— Server-Sent Events writer on top of HTTP/1.1 chunkedcache.lp— actor-owned KV cache with capacity (LRU) and optional TTLgrain.lp— virtual actors (grains):GrainServer/GrainStore/RedisGrainStore, directory + owner + lease single-activation, cross-node leasing with a fence token, pluggable storesmtp.lp—SmtpConf(host / port / security / user / password / sender) andSmtpResult(ok / stage / detail); the protocol itself is in thesmtpplugin
Connection pools (plugins — interpreter / AOT)
postgres_pool.lp— fixed-size pool over thepostgresplugin,withConn:APImariadb_pool.lp— fixed-size pool over themariadbplugin (MariaDB / MySQL)redis_pool.lp— fixed-size pool over theredisplugin (Redis / Valkey)
Supervision
supervision.lp— one-for-one / one-for-all / rest-for-one strategies onmonitor:+spawn:
TERIOS toolkit (stdlib/terios/)
terios/rpc.lp— TERIOS RPC envelope dispatch (serviceName/requestDto/responseDto/errorInfoList)terios/auth.lp— bearer-token auth scaffold + HTTP middlewareterios/transformer.lp— declarative JSON reshaping engine (DataTransformer port)terios/validators.lp— declarative validators for thevalidates:class-decl keyword
TORM toolkit (stdlib/torm/)
torm/entity_listener.lp—EntityListenerprotocol withprePersist:/postLoad:style hookstorm/select_options.lp— Doma-style immutable SELECT options (paging / lock hints)