Reference, 0.18.0
The standard library
Every type the prelude gives a program and every module under std/, with each signature and doc comment exactly as iyi doc prints it for v0.18.0.
Recorded with iyi 0.18.0 at 2a9653052, and checked on every build against the source that release ships.
Prelude
In every program, with no import.
ArrayThe one sequence — SPEC.md, "0.1.0", item 3.Atomiciyi: Atomic(T) — a word two threads may both write.Booltrue and false.CancelledWhat a wait answers when its task was cancelled (III.4.2): an error member.ChannelChannel(T).new is a rendezvous, as Crystal's is: a send completes when a receive takes it, and either side parks until the other arrives.ChannelClosedCharOne character - a byte, in this prelude, which reads its strings as ASCII.ClassEnumWhat an enum can do — SPEC.md, "0.1.0", item 3.FileFloat64HashThe one dictionary — SPEC.md, "0.1.0", item 3.Int32The comparison cross is the one UInt16 joins, and only it: the conversions above stay at five, because std/int declares the whole tower's conversions and a prelude that also declared UInt16#to_i32 would be redefining one of them (SPEC.md R-3, which is how this split announced itself).Int64A 64-bit signed integer, the literal 1_i64.NilThe absence of a value, and the only value of its type.ObjectWhat the compiler emits instructions for — SPEC.md, "0.1.0", item 3.PanickedWhat a caught panic answers as — III.1.4's "catchable at task boundaries", made literal: reading a panicked task's value delivers this instead of a re-raise, and III.1.3's machinery (case, !, .or) handles it like any other failure.PointerA raw address: Pointer(T).malloc(n) is n elements of untyped memory, [] and []= read and write them, nothing checks the bounds.ProcProgramThe running program: its arguments and its environment, on demand.RangeRanges — SPEC.md, "0.1.0", item 3.ReferenceWhat every class instance is: a pointer to its fields, compared and hashed by identity unless the class says otherwise.SetThe one set — "have I seen this", with nothing attached to the answer.StringText — SPEC.md, "0.1.0", item 3.StructA struct is its fields, as the other library's Struct#== has it: two are equal when each field is.SymbolA name that compares by identity: :ok, :err.TupleA tuple written the way it is written: {1, "a"}.TypeCastErrorA failed .as in select expansion is a compiler bug; this panic carries the constant's name rather than an exception type.UInt16UInt64UInt8The unsigned pair, which the prelude did not declare: UInt64's division and modulo, and text for both.
Modules
Opt in with import std/....
std/aeadAuthenticated encryption, written in iyi: AES (FIPS 197) and AES-GCM (NIST SP 800-38D), ChaCha20 and Poly1305, and the two together as ChaCha20-Poly1305 (RFC 8439).std/annotationsCompiler annotations, re-exported for import std/annotations::{...}.std/asn1ASN.1 values read from DER (ITU-T X.690, the Distinguished Encoding Rules), written in iyi: what a certificate, a key or a signature is written in.std/atomiciyi: the weaker atomic verbs, and the bitwise ones, on the prelude's Atomic(T).std/base32Base32, RFC 4648 section 6, and Base32hex, section 7, written in iyi.std/base64Base64, RFC 4648, written in iyi.std/benchmarkTiming a block: wall-clock ips and bm, built on std/time.std/bigArbitrary precision numbers: BigInt, BigDecimal, BigRational and BigFloat.std/bit_arrayCompact array data structure storing bits as booleans.std/booliyi: the rest of Bool, added to the prelude's.std/boxBox allows turning any object to a Void* and back.std/bzip2bzip2 (Julian Seward's format, as libbzip2 1.0.8 writes and reads it), both ways, written in iyi; no libbzip2 is linked.std/capsuleHTTP Datagrams and the Capsule Protocol — RFC 9297, RFC 8441, RFC 9220, RFC 9000.std/colorizeTerminal colour and style: "text".colorize.red.on_blue.bold is the text wrapped in the ANSI SGR escape that paints it, and back to plain text with \e[0m.std/complexstd/compressDEFLATE (RFC 1951), and the two envelopes it travels in: zlib (RFC 1950) and gzip (RFC 1952).std/cookieCookies (RFC 6265), for both ends of std/http: Cookie reads a Set-Cookie line as a user agent reads one and writes one as a server writes one, and CookieJar is the client's store, handed to HTTP.request(..., jar: jar) (it is std/http's CookieStore).std/cryptoKeyed hashing and key derivation over std/digest, written in iyi: HMAC (RFC 2104), HKDF (RFC 5869), PBKDF2 (RFC 8018 §5.2), and a comparison whose time does not depend on where two byte strings differ.std/csvCSV, RFC 4180, written in iyi.std/curve25519X25519 (RFC 7748) and Ed25519 (RFC 8032), written in iyi on the field of integers modulo 2^255 - 19.std/debugDebug symbols and backtrace resolution for iyi programs.std/dequeDeque, a double-ended queue over a ring buffer.std/derivesDerives, as a library module (SPEC.md R-5, II.4).std/digestDigests, written in iyi: MD5, SHA-1, the SHA-2 family (SHA-224, SHA-256, SHA-384, SHA-512), the SHA-3 family (SHA3-224, SHA3-256, SHA3-384, SHA3-512) with its extendable-output functions SHAKE128 and SHAKE256, CRC-32, CRC-64 and Adler-32, and the non-cryptographic XXH64.std/dirDir: directory stream and filesystem directory operations.std/dnsDNS: the wire format, the resolver's configuration file and the hosts file, read by iyi itself.std/ecdsaECDSA signatures checked (FIPS 186-5, SEC 1), written in iyi, on the NIST curves P-256, P-384 and P-521.std/eiyEiy: embedded iyi.std/enumiyi: the rest of Enum, added to the prelude's.std/enumerableEnumerable — SPEC.md II.6.std/envENV: hash-like accessor for process environment variables.std/errnoErrno wraps and gives access to libc/platform errno values.std/fileFile: comprehensive file operations, metadata inspection, and manipulation.std/file_utilsFileUtils: the operations on files and trees that are made of several calls - copy a file, copy a tree, remove a tree, move a file or a tree to another device, compare two files - under Crystal's name for them.std/fileserverFiles served from a directory: what a server's block answers with FileServer.serve(root, request) for the requests it means to be files.std/floatFloat32, made a number, and what Float64 still lacked.std/formatFormat strings for iyi.std/gciyi: GC — the program's window onto iyi's own collector.std/heapA binary heap over Comparable.std/hpackStandard HPACK: Header Compression for HTTP/2 (RFC 7541)std/htmlStandard HTML escaping and unescaping library for iyi.std/httpHTTP/1.1 and HTTP/2 over IyiSocket, written in iyi: a client, a server, and the bodies between them as streams.std/http_proxyThe proxy the environment names for a URL: HTTPProxy.from_env(url), for HTTP.open's and HTTPClient.new's proxy.std/idnaInternationalized domain names: Punycode (RFC 3492) and host names carried to and from their ASCII form label by label (IDNA2008: RFC 5890, 5891 and 5892).std/indexableIndexable: random access.std/iniINI configuration text: [section] headers, key = value lines, comments opened by # or ;, and keys before the first header filed under the section named "".std/intThe whole integer tower: Int8, Int16, UInt16, UInt32, Int128 and UInt128 made as usable as the prelude's Int32, Int64, UInt8 and UInt64.std/iostd/io: byte streams beyond the standard ones.std/iteratorIterator: lazy sequences.std/jsonJSON, read and written in iyi: a byte lexer and a recursive parser into Any, a streaming PullParser, a Builder that writes a document one value at a time, and JSON.parse / JSON.parse?std/kernelKernel methods and top-level utilities.std/levenshteinLevenshtein distance methods for iyi.std/listList, the shareable immutable sequence — SPEC.md III.4.7.std/logLevelled logging with named sources.std/mailInternet mail messages (RFC 5322) with MIME (RFC 2045 to 2047, RFC 2231): a message built from its parts, and a message read back into its headers, its tree of parts and their decoded bodies, written in iyi.std/mathstd/mimeMedia types for naming and serving files: the type a file name's extension stands for, the extensions a type is written with, whether a type is worth compressing on the wire, the type with its charset, and RFC 9110's type/subtype; name=value parsed.std/mutexMutex(T): a value two tasks or two threads may both change, kept behind a lock.std/named_tupleNamedTuple methods the prelude does not carry: dynamic key access, merge, clone, and conversion to Array/Hash.std/netipIP addresses and prefixes as values, the way Go's net/netip holds them and Python's ipaddress reads and classifies them: no socket, no resolver, nothing of the platform.std/numberstd/number_formatNumbers as people read them: digits in groups, and quantities with a prefix.std/option_parserFlag parsing, written in iyi.std/otpOne-time passwords, written in iyi: HOTP (RFC 4226), TOTP (RFC 6238), and the otpauth:// key URI an authenticator app reads from a QR code (Google Authenticator's Key Uri Format, which is the de facto spec: https://github.com/google/google-authenticator/wiki/Key-Uri-Format).std/p256ECDSA signatures made on P-256 (FIPS 186-5, SEC 1, RFC 6979), and its Diffie-Hellman (ECDH, SEC 1 section 3.3.1), written in iyi, in constant time.std/passwordPassword hashing, written in iyi: bcrypt (Provos and Mazières, USENIX 1999, as OpenBSD's bcrypt.c writes it) on its own Blowfish, and scrypt (RFC 7914) on std/crypto's PBKDF2-HMAC-SHA256 and a Salsa20/8 core.std/pathFile system paths, read lexically: nothing here touches the file system.std/pngPNG images (ISO/IEC 15948:2004, and the W3C's Portable Network Graphics Specification, Third Edition, 2025, which is the same format with APNG and cICP written down), read and written in iyi over the zlib of std/compress and the CRC-32 of std/digest.std/processProcesses: run another program, and read what it said.std/randomA PCG-32 generator, and a handful of random values from it - the same stream, draw for draw, as the other library's Random.new(seed), so a program seeded there and ported here prints the same numbers.std/reference_storageReferenceStorage(T) provides the minimum storage for the instance data of an object of type T.std/regexRegular expressions, RE2's contract, written in iyi.std/routerA request router for std/http: Router#handle(pattern) { |req, params| Response } registers a handler, and router.call(req) is what a Server.serve block answers with.std/rsaRSA signatures (RFC 8017), written in iyi: PKCS #1 v1.5 and PSS, checked over SHA-1, SHA-256, SHA-384 and SHA-512, and made over the last three.std/semantic_versionSemantic versions, as Semantic Versioning 2.0.0 spells them: MAJOR.MINOR.PATCH, an optional -prerelease of dot-separated identifiers, an optional +build tail.std/setThe set algebra the prelude's Set(T) does not have.std/shlexShell-style words, read and written the way Python's shlex reads and writes them in POSIX mode: Shlex.split is shlex.split(s, comments), Shlex.quote is shlex.quote and Shlex.join is shlex.join, rule for rule, so a command line a program builds here is the one a Python tool beside it would build, and the one /bin/sh reads back.std/signalSignals: a program told to stop, as a value it waits for.std/sliceSlice, a bounded pointer — SPEC.md III.std/smtpAn SMTP client (RFC 5321) over std/socket and std/tls, written in iyi: it hands a mail server what std/mail builds.std/socketSockets: TCP networking for iyistd/sseServer-sent events (the WHATWG HTML Living Standard, §9.2): a stream of text events over one long HTTP response, text/event-stream, for both ends of std/http.std/static_arrayFixed-size stack-allocated array for iyi.std/steppablestd/string_poolInterned strings: the same bytes become the same String object.std/string_scannerA lexical scanner over one string: an offset that moves forward as patterns match at it, and the last match kept for its groups - the other library's StringScanner, which is Ruby's strscan, for the tokenizer a small language or a wire format needs.std/symbolstd/systemSystem: what the machine this program runs on is called, how many CPUs the program may run on, and how large a memory page is.std/system_rootsThe root certificates the operating system trusts, read as std/x509 certificates: the roots a TLS client hands X509.verify.std/tarTar archives - POSIX.1-2001 pax and ustar (IEEE Std 1003.1, the pax utility's "ustar Interchange Format" and "pax Interchange Format"), read and written in iyi, with GNU's long names and the old v7 header read as well, .tar.gz through the DEFLATE of std/compress, .tar.bz2 read through std/bzip2, and .tar.xz read through std/xz.std/termTerminals: whether a stream is one, how big it is, and the two modes a program asks a terminal for — raw, and echo off — for the length of a block, with the previous mode put back however the block ends.std/textStandard text processing library for iyi.std/timeTime, Time::Span and Time::Location: the wall clock, the monotonic clock, time zones, civil-calendar arithmetic, strftime-style formatting and parsing (Time::Format), and the named formats: RFC 3339, ISO 8601, RFC 2822 and the HTTP date of RFC 9110.std/tlsTLS 1.3 (RFC 8446), both ends, written in iyi from the RFCs: a client whose server's certificate std/x509 checked - which speaks TLS 1.2 too when asked to - and a server whose Ed25519, P-256 or RSA key signs for it, over std/socket.std/tomlTOML 1.0.0 (https://toml.io/en/v1.0.0), read and written in iyi alone: a reader that answers a document as an Any or a TOMLError saying what is wrong and where, a writer whose text reads back to the value it was given, and derive toml_serializable.std/traitsComparable, Num and Hashable over the prelude's scalars, and Hashable over the other keys a table takes: tuples, named tuples, arrays, nil and symbols.std/tupleSize, equality, each and printing for the prelude's Tuple and NamedTuple.std/udpDatagram sockets: UDP networking for iyistd/unicodeThe Unicode Character Database, as questions a program asks of a character and of a string: which general category a code point is in, what its upper, lower, title and folded case are, whether a byte sequence is well-formed UTF-8, how a string reads in UTF-16, and the four normalization forms.std/uriURI references as RFC 3986 spells them: scheme, userinfo, host, port, path, query and fragment, read by URI.parse (URI.parse?std/userUsers and groups: who this program runs as, and the accounts and groups the machine knows by name or by number.std/uuidUUIDs, RFC 9562 (which replaced RFC 4122), written in iyi.std/weak_refWeak references: a WeakRef(T) names an object without keeping it alive.std/websocketWebSocket (RFC 6455) over std/http: the server's handshake, the client's, and the frames after them, written in iyi.std/x509X.509 certificates read and chains checked (RFC 5280), written in iyi: what a TLS client asks of a server's certificates.std/xmlXML for iyi: a well-formedness parser, a document tree, a serializer, and XPath 1.0.std/xzLZMA and LZMA2 decompression, and the two files they travel in: the .xz container (The .xz File Format, version 1.0.4, Tukaani project, 2009-08-27, which 1.2.1 restates) and the legacy .lzma file that LZMA Utils and the LZMA SDK write (liblzma calls it LZMA_Alone).std/yamlYAML, read and written in iyi alone: a parser and an emitter for the YAML 1.2 core schema over the bytes of a String, with no library under them.std/zipZIP archives (PKWARE's APPNOTE.TXT 6.3.10), read and written in iyi, with the DEFLATE of std/compress, the bzip2 of std/bzip2, the Zstandard of std/zstd, the LZMA and xz of std/xz, and the CRC-32 of std/digest.std/zstdZstandard (RFC 8878), read and written in iyi; no libzstd is linked.