Standard library
The standard library
43 modules, all written in Rill, imported by their path under lib/: import "data/json" as json. The compiler finds them beside its own bin/ in a packaged toolchain, or through RILL_PATH. These pages are what rill doc lib writes: the comment above each declaration, and the signature the checker infers for it.
Text lib/text
- fmttext/fmtText laid out and numbers spelled: a template with slots, padding by width, a float to so many places, thousands separated, a size in bytes, an ordinal, a table with its columns lined up.
- pathtext/pathFile paths as text: joining, taking apart, tidying.
- regextext/regexRegular expressions: a small backtracking matcher, written in Rill.
- strtext/strStrings, past what the prelude gives.
Data formats lib/data
- checksumdata/checksumThe two checksums a file format is likely to ask for: CRC-32 (IEEE 802.3, the one in zip, gzip and PNG) and Adler-32 (zlib's).
- csvdata/csvCSV, read and written, as RFC 4180 has it: a field is quoted when it holds the separator, a quote, or a line break; a quote inside a quoted field is doubled; a line ends in \n or \r\n.
- deflatedata/deflatest holds the position in the data, the bits read but not yet used, how many of them there are, and whether the data ran out.
- jsondata/jsonJSON, written in Rill: a recursive-descent parser and a printer.
- yamldata/yamlWhat is left to read, and the value read so far.
Collections lib/coll
- dequecoll/dequeA queue with both ends open: push and pop at the front or the back, each in constant time on average.
- heapcoll/heapA priority queue: the least element is always at the top, and taking it costs a logarithm.
- setcoll/setA set of values: a hash table with only keys, so membership is a lookup rather than a walk.
Numbers lib/num
- bigintnum/bigintIntegers of any size, written in Rill.
- colnum/colColumn aggregates, vectorized by hand.
- decimalnum/decimalDecimal numbers with a fixed number of places: money, and anything else where 0.1 + 0.2 has to be 0.3.
- gridnum/gridgrid — arrays of numbers with a shape, the way NumPy has them.
The web lib/web
- formweb/formThe fields, by the content type: pairs become parts with no file name and no type.
- httpweb/httpA small HTTP/1.1 server, written in Rill on top of the socket builtins.
- mimeweb/mimeThe media type a file is served as, from its name: mime.of_path("a/b.png") is image/png.
- tlsweb/tlsA connection: the OpenSSL object, its context, and the socket under it.
- tmplweb/tmplThe runtime half of the template engine: what a generated template calls.
- urlweb/urlURLs taken apart and put together (RFC 3986): the scheme, who, the host, the port, the path, the query, the fragment; a query as pairs; a relative reference resolved against a base; percent-encoding both ways.
- wsweb/wsWebSocket (RFC 6455) on top of the socket builtins: the handshake, and text or binary frames in both directions.
The network lib/net
- dnsnet/dnsEvery address the name has, IPv4 addresses first and then IPv6, or why there are none.
- udpnet/udpA socket bound to port on every interface; 0 for one the system picks.
Databases lib/db
- kvdb/kvA key–value store on disk: a B+ tree of 4 KB pages, a page cache, and a write-ahead log — the shape SQLite's file layer has, in Rill, for one process at a time.
- oxidbdb/oxidbOne request, one reply, unwrapped into a Result.
- oxirecdb/oxirecOne basket: who it was, what was in it, and when.
- oxirespdb/oxirespA client for OxiDB's in-memory key-value engine, written in Rill.
- oxisqldb/oxisql? in the text takes the next value from params, which is how a value reaches the engine without being written into the statement.
- oxitsdbdb/oxitsdbEvery request names the engine as well as the command: the server mounts the time-series engine beside the document and SQL ones, and engine is what tells them apart.
- oxiwiredb/oxiwireAnswers a Parsed — the JSON module's, so a frame that will not decode travels out the same way a document that will not parse does.
The command line lib/cli
- argscli/argsCommand-line arguments: what a program takes, said once, and then parsed, checked and explained from that one saying.
- envcli/envThe variable's value, or None when it is not set.
- logcli/logThe level from the RILL_LOG variable — debug, info, warn, error, or off — and info when it is unset or says something else.
- proccli/procThe exit code and what the command wrote.
Cryptography lib/crypto
- passwdcrypto/passwdHMAC-SHA-1.
- sha1crypto/sha1SHA-1 and base64, written in Rill.
- sha2crypto/sha2The digest, as 32 raw bytes.
Randomness lib/random
- rndrandom/rndRandom numbers, from a generator that is a value.
- uuidrandom/uuidUUIDs (RFC 9562): the random kind, version 4, and the time-ordered kind, version 7, whose first 48 bits are the millisecond it was made, so a column of them sorts by when.