Skip to content
FutureBlitz

    Install

    The standard library

    std 0.1.0: 206 modules in 22 areas, with 945 public declarations, generated from std's own doc comments by fb doc.

    Every name of std's needs its Import, std.core's too: Import std.core brings in Print, Error, and the Interfaces. Importing a folder, like Import std.collections, brings in each of its files' modules. A program gets only the library code it uses, and the C libraries std builds on are linked in only when it calls them.

    std.core

    Print and Input, errors, the Interfaces, iterators, ranges, formatting and parsing, and Value.

    • std.core.assert AssertEqual: an Assert that says what it compared.
    • std.core.error Error, the Class every error extends, and each area's own: one Error per area, whose Kind says what went wrong, so a Throws list stays short and a Catch can still tell kinds apart.
    • std.core.format Formatting by a template that the program has only when it runs: Format, whose fields take interpolation's specs, which the runtime splits; and the debug form, "{x:?}", which the compiler makes for every type, and Dump.
    • std.core.interfaces The Interfaces that the language's operators and strings work through.
    • std.core.iterator What 'For ...
    • std.core.load What `Load<T>`(value) and Save(x) read: the attributes on a Struct's or Class's Fields that change how they're loaded and saved, and the Interfaces of a type that converts itself.
    • std.core.parse Text to numbers and Bools: Parse, a Static Method on each, which gives Null for text that isn't one, or a number that doesn't fit.
    • std.core.print The program's console: what it writes to stdout and stderr, which show what it wrote in its order, and the lines it reads from stdin.
    • std.core.range `Range<T>`: the integers a range gives, like 0 Until 10, 1 To 10, or 10 To 0 Step -2, which are the values a For loop with those bounds counts.
    • std.core.value Value: data of any shape, as the data formats have it: Null, a Bool, an integer, a Double, a String, bytes, an Array of Values, or an Object of Values by their keys, in the order they were added.
    • std.core.values Small things for any values: the smaller and larger of two, a value kept between two others, swapping two variables, and a hash of two hashes.

    std.collections

    Map, Set, Stack, Queue, Deque, PriorityQueue, Pool, Trie, LRU caches, spatial grids, and arrays' methods.

    • std.collections.array What every collection has, on T[], besides the built-in Add, Insert, RemoveAt, Clear, Contains, Clone, Reserve, TrimExcess, Count, and Capacity: searching, the ends, many elements at once, order, and shape.
    • std.collections.bit_set BitSet: a Set of Ints from 0 up, a bit each in an array of words, which grows to hold the largest.
    • std.collections.counter `Counter<T>`: how many times each value was added, in the order the values were added.
    • std.collections.deque `Deque<T>`: values added and taken at either end.
    • std.collections.grid `Grid<T>` and `Grid3<T>`: a fixed number of values in columns and rows, and in layers too, read and set by position, like a map's tiles or a volume's voxels.
    • std.collections.immutable `ImmutableArray<T>`, `ImmutableMap<K, V>`, and `ImmutableSet<T>`: collections that never change, so any thread can read one.
    • std.collections.interval_tree `IntervalTree<K, V>`: values, each over an interval of keys from a low to a high, both in it, which finds the intervals that overlap another, or hold a key, without going over the others.
    • std.collections.linked_list `LinkedList<T>`: values in a chain of nodes, each linked to the ones before and after it, so adding or removing one beside a node takes the same time however many there are.
    • std.collections.lru_cache `LruCache<K, V>`: up to Capacity entries, dropping the one used least recently to make room for a new key.
    • std.collections.map `Map<K, V>`: a hash map from keys to values, in the order they were added.
    • std.collections.multi_map `MultiMap<K, V>`: keys that each have one value or more, in the order they were added: a Map from each key to an array of its values, in the order they were added too.
    • std.collections.pool `Pool<T>`: values kept by Handles that stay valid until their value is removed, like a game's enemies.
    • std.collections.priority_queue `PriorityQueue<T>`: Pop gives the value that comes first, the smallest unless a before function says what comes first.
    • std.collections.queue `Queue<T>`: first in, first out.
    • std.collections.ring_buffer `RingBuffer<T>`: the last values added, up to its Capacity, oldest first.
    • std.collections.set `Set<T>`: values without repeats, in the order they were added, which a Map holds as its keys.
    • std.collections.sorted `SortedMap<K, V>` and `SortedSet<T>`: keys in order, in a B-tree.
    • std.collections.spatial `SpatialHash<T>`, `QuadTree<T>`, and `Octree<T>`: values at points, found by where they are, the ones in a box or near a point, without going over the others.
    • std.collections.stack `Stack<T>`: last in, first out.
    • std.collections.trie `Trie<V>`: String keys and their values in a tree with a node for each prefix of the keys' bytes, so the keys with a prefix, or the longest key a text starts with, are found by going down the prefix alone.
    • std.collections.view Views that don't copy what they show: part of an array, which reads and sets it in place, and an array, Map, or Set to read but not change, to hand out.

    std.text

    Unicode, regex, Markdown, templates, diffs, fuzzy matching, glob patterns, and encodings.

    • std.text.builder StringBuilder: text built up a piece at a time, in a buffer of its UTF-8 bytes that grows as pieces come, so building a String of many pieces takes time in proportion to its length, where joining them one by one would copy it each time.
    • std.text.char A Char's Methods: its code, what kind of character it is, as Unicode's general categories say, and its own uppercase and lowercase, through the runtime's fb_unicode_ functions over utf8proc.
    • std.text.diff std.text.diff: what changed between two texts, by Myers' algorithm, which finds the fewest lines, or characters, to delete and insert.
    • std.text.encoding std.text.encoding: text to and from bytes in encodings other than a String's own UTF-8 (UTF-16 and UTF-32, little- and big-endian, ASCII, Latin-1, and Windows-1252), with the byte order mark (BOM) that starts some files found or written; bytes as text and back (Base64, Hex, and Base32); and text escaped for a URL, for HTML, or as a FutureBlitz string literal writes it.
    • std.text.fuzzy std.text.fuzzy: fuzzy matching, as fzf does it.
    • std.text.glob std.text.glob: a shell's wildcards, matched against all of a String, a character at a time.
    • std.text.humanize std.text.humanize: values as people say them, in English.
    • std.text.layout std.text.layout: a String's lines laid out again.
    • std.text.markdown std.text.markdown: CommonMark, with tables, task lists, strikethrough, and autolinks as asked, over md4c: Markdown as HTML, and as a tree of its blocks, spans, and text to walk.
    • std.text.regex std.text.regex: patterns over PCRE2, through the runtime's fb_regex_ functions.
    • std.text.scanner Scanner: reads text from its start, a character, a word, a line, or a number at a time, for a parser, and keeps the Line and Column of what it reads next, where an error can point.
    • std.text.string A String's Methods, by byte position.
    • std.text.template std.text.template: Mustache-style templates, which a Value fills, or a Struct, a Class, or a Map, through the Value that Save makes of it.
    • std.text.unicode std.text.unicode: what Unicode's data says about characters and text, through the runtime's fb_unicode_ functions over utf8proc: each character's general category, normal forms, case folding, and the columns text takes in a terminal.

    std.math

    Vectors, matrices, Quat, colors, geometry, Random, noise, easing, stats, units, and BigInt and Decimal.

    • std.math.big.bigint BigInt: an integer of any size, over libtommath, which never changes once it's made.
    • std.math.big.complex Complex: a complex number, Real + Imaginary times i, as two Doubles, and worked out as Python's cmath does: Arg is from -pi to pi, and Log, Sqrt, and Pow give the principal value, scaled near the largest Doubles and among the subnormals as cmath scales them, with C99's values at infinities.
    • std.math.big.decimal Decimal: a decimal number, over mpdecimal, which never changes once it's made.
    • std.math.big.rational Rational: a fraction of two BigInts, which never changes once it's made, kept in lowest terms with its denominator above 0, so its arithmetic is exact: 1/3 + 1/6 is 1/2.
    • std.math.bits std.math.bits: an integer's bits, counted, rotated, swapped, and aligned, for any integer type, and saturating arithmetic beside the Checked and Wrapping Methods the integers have.
    • std.math.color Color and Color32.
    • std.math.constants The constants of math, as Floats, the type std.math works in, and as Doubles, named with 64: Pi64.
    • std.math.curves Curves and splines in 2D and 3D: a point t of the way along a quadratic or cubic Bezier, a Hermite curve, a Catmull-Rom segment, or a uniform cubic B-spline segment; and Curve2 and Curve3, which join a run of points into one curve, through them or near them, and go along it by its length, as a path's followers and its evenly spaced fence posts need.
    • std.math.easing Easing: how far along an animation is at a time t from 0 to 1, from 0 at its start to 1 at its end, for each of the usual curves, as easings.net draws them.
    • std.math.fixed Fixed32 and Fixed64: fixed-point numbers, 16.16 in an Int32 and 32.32 in an Int64, whose math is all integer math, so the same program gives the same bits on every OS and CPU, in debug builds and release, for lockstep multiplayer and replays.
    • std.math.geometry The shapes for finding what's where: Rect in 2D, and AABB, Sphere, Ray, Plane, and Frustum in 3D, with Contains, Intersects, and Raycast.
    • std.math.int_vector Vec2i and Vec3i: points and steps on a grid, as Ints, for cells, tiles, and voxels, and as Map keys.
    • std.math.matrix Mat3 and Mat4: matrices of Floats, column-major, as the GPU takes them.
    • std.math.noise Noise: smooth random values over space, the same at the same place, for terrain, clouds, and wobble: Ken Perlin's improved gradient noise, Stefan Gustavson's Simplex noise, value noise, Steven Worley's cellular noise, and fractal Brownian motion, a sum of Perlin noise's octaves.
    • std.math.numbers What the built-in number types share, for std.math's generic Functions: Bounded, the types with a lowest and a highest value, which every number type is; Integer, the eight integer types; and FloatingPoint, Float32 and Float64, over C's libm.
    • std.math.polygon Polygons: a ring is a Vec2[] of corners, closed from the last back to the first, and a region is a Vec2[][] of rings, filled where they wind around a point other than 0 times, as SVG's nonzero rule fills it, so its outer rings go counterclockwise and its holes clockwise.
    • std.math.quat Quat: a rotation, as a unit quaternion of Floats, x, y, z, and w.
    • std.math.random Random: a seeded generator of random numbers, PCG32, Melissa O'Neill's permuted congruential generator, so a seed gives the same numbers in every build, on every OS and CPU, which replays, tests, and level seeds need.
    • std.math.scalar The scalar Functions: signs, whole parts, remainders, divisors, the steps between two values, powers and logs, trig and its hyperbolic twins, and IEEE's checks, each in its arguments' type, for the number types it makes sense for.
    • std.math.stats Statistics of numbers of any type, worked out in Doubles: the mean, the median, the variance and standard deviation of a sample and of a whole population, percentiles, and histograms.
    • std.math.units Typed units: a Quantity is a value in SI's base units, meters, kilograms, and seconds, with the exponents of its length, mass, and time as Const type arguments, so the compiler keeps Meters apart from Seconds and works out what Meters / Seconds is.
    • std.math.vector Vec2, Vec3, and Vec4: points and directions, as Floats, in the space std.math works in: right-handed, Y up, and -Z forward.

    std.io

    Path, File, Dir, streams, memory-mapped files, a virtual file system, file watching, and Preferences.

    • std.io.binary Binary streams: BinaryReader reads numbers, Bools, bytes, and text from a Reader, and BinaryWriter writes them to a Writer, each number's bytes in the order its ByteOrder says, whatever the machine's own order is.
    • std.io.buffered Buffered streams: BufferedReader reads another Reader a buffer at a time, so that many small reads, a byte or a line at a time, cost one of its; BufferedWriter writes another Writer a buffer at a time.
    • std.io.dir std.io's folders: making and removing them, what's in one, and in the folders in it, the paths in one that a glob pattern matches, and the current and temporary folders.
    • std.io.file std.io's files, a call at a time: reading and writing a whole file's bytes, text, or lines, adding to one, writing one atomically, what's at a path, and copying, moving, and deleting.
    • std.io.file_stream std.io's open files: File.Open gives a FileStream, a Reader, Writer, and Seeker over a file, which reads and writes where it is, as Seek moves it, with Async twins that libuv's thread pool does while the main thread goes on.
    • std.io.lock std.io's file locks: a FileLock holds a lock on a file, which another FileLock, in this program or another, waits for, or is refused, until it's closed.
    • std.io.mapped std.io's mapped files: a file's bytes mapped into memory, read and written in place, without copying the file in, which the OS pages in as they're used.
    • std.io.memory Streams over memory: MemoryStream, bytes to read, write, and move around in, as a file's are; StringReader, which reads a String's UTF-8; and StringWriter, which collects text.
    • std.io.path std.io's paths: a Path is where a file or folder is, as text, read by Windows' rules or POSIX's, the target's unless it's made with the other's.
    • std.io.preferences std.io's preferences: a program's settings, kept between its runs in the folder each OS keeps its users' programs' settings in, in a file of the program's own, which a save replaces whole.
    • std.io.request What std.io's files share: the runtime's request for a call, which holds what the call gives, and the IOError for one that failed.
    • std.io.streams std.io's streams: Reader, what bytes come from, and Writer, where they go, each with Async twins that wait on the main thread instead of blocking it, as a file or a socket does; Seeker, what moves around in them, which only blocks; and Copy, ReadAll, and ReadExact over them.
    • std.io.temp std.io's temporary files and folders: each is new, in the OS's temporary folder, with a name no other has, and goes away, with what's in it, when it's closed, or when its last reference goes.
    • std.io.vfs std.io's virtual file system: a Vfs mounts folders, embedded folders, zips, and a program's own sources at points in one tree of its own, and reads them through the same calls as files.
    • std.io.watcher std.io's file watcher: what happens to a file, or to what's in a folder, as the OS tells libuv, which a FileWatcher queues for the program to take in turn, waiting for it, awaiting it, or not.

    std.time

    Duration, Timestamp, dates and times of day, calendars, timers, and time zones.

    • std.time.calendar The calendar's types, in the proleptic Gregorian calendar and without a zone: Date, a day; TimeOfDay, a time on a day's clock, to the nanosecond; and LocalDateTime, the two together.
    • std.time.clock The monotonic clock, which never goes back or jumps as the OS's clock can, for how long things take: Instant, a reading of it; Stopwatch and Measure over it; and Sleep.
    • std.time.duration Duration: a span of time to the nanosecond, as an Int64 of them, from about 292 years before to 292 years after.
    • std.time.format std.time's formats: ISO 8601, as each type's ToString and Parse write and read it; RFC 2822, as email has it, like "Fri, 23 Oct 2026 14:30:00 +0200"; and patterns, for Format and the Parse that takes one, whose letters stand for the parts of a date, time, or zone:
    • std.time.timers Waiting and pacing: Timer, on the I/O thread's loop, for Tasks that are done after a while, which any thread can wait for; Deadline, a time to give up at, as blocking calls take one; FixedStep, for a game loop's updates at a fixed rate; RateLimiter, which lets so many things happen in so long; and Debounce, for acting once a burst of events has stopped.
    • std.time.timestamp Timestamp: a point in time, in UTC, to the nanosecond, from the year -999999999 to 999999999, as the real clock and Unix times give one.
    • std.time.zone TimeZone, a zone's rules for its clocks: one of the IANA tz database's, which the runtime embeds, like "Europe/Paris", with every offset and daylight saving change it has had and will have; a fixed offset from UTC; or the OS's own.

    std.os

    Command-line Args, the environment, standard folders, processes, and signals.

    • std.os.args Args: a program's command line, read into a Struct or Class.
    • std.os.env Env, the environment's variables, which the program starts with and passes on to what it starts: Get, Set, Unset, All, and Expand, which any thread can use, and Load, which sets those a .env file names.
    • std.os.folders Folders, where the OS keeps the user's things and the program's, each where that OS's own apps keep them; and OpenDefault, which opens a file, a folder, or a URL in the app the OS opens it with.
    • std.os.process Process, the program's own: its Id, and Exit, which ends it with a code for what started it.
    • std.os.process_child Child, a program that a Command started, which runs beside this one: its Id, its piped streams, a Writer to its stdin and Readers of its stdout and stderr, and Wait, TryWait, and Kill, with the ExitStatus that says how it ended.
    • std.os.process_command Command, a program to start, with its arguments, environment, folder, and streams, and no shell, so each argument reaches it as it is, on every OS: Spawn starts it beside this program, and Output and Status wait for it to end.
    • std.os.process_signals Process.OnInterrupt and Process.OnTerminate: handlers for the signals every OS has, which the program then gets instead of ending at once, until its code is done.
    • std.os.system System, what the program knows of the machine it runs on: the platform and architecture it was built for, how many threads can run at once, the memory, and the machine's and user's names.

    std.concurrent

    Locks, ConcurrentMap, concurrent queues, Lazy, parallel algorithms, and cancellation.

    • std.concurrent.cancellation Cancellation: a flag that code sets to stop work under way, on any thread.
    • std.concurrent.channels A Channel's waits that a Cancellation stops, and Selector, which waits on several Channels at once, and a timeout.
    • std.concurrent.concurrent_map `ConcurrentMap<K, V>`: a hash map that any number of threads change and read at once.
    • std.concurrent.concurrent_queue `ConcurrentQueue<T>`: first in, first out, for any number of threads at once, with no limit but memory and what an Int counts.
    • std.concurrent.lazy `Lazy<T>`: a value made the first time a thread asks for it, by the Sendable Func it was given, once however many threads ask at once: the others wait while it's made, and each gets the same value.
    • std.concurrent.locks The locks any thread can use at once, over the runtime's: a Semaphore of permits, a Barrier that threads meet at, a WaitGroup that waits for work under way, a Once that runs its work one time, and an `RwLock<T>`, whose value many threads read at once, or one writes alone.
    • std.concurrent.parallel The parallel algorithms: ParallelForEach, ParallelMap, ParallelReduce, and ParallelSort, each a Parallel For on the job pool, with the calling thread taking its share, over an array of Sendable values and a Sendable Func, which each pass calls on the thread that runs it.
    • std.concurrent.tasks Tasks made of other Tasks, and a Task finished by hand: WhenAll waits for each of its tasks, WhenAny for the first, and a TaskSource's Task is done once a thread has given it its result, and a ThrowingTaskSource's once the main thread has given it its result or its error.

    std.log

    Logger, with levels, filters, outputs, and log files.

    • std.log.files std.log's sinks into files: FileSink adds each line to a file's end, and RotatingFileSink does until the file's as big as it's let be, then moves it aside, keeping a few of the old ones.
    • std.log.level LogLevel, how much a log line matters, and LogFilter, the least level written for each module, as FB_LOG's text sets it: "debug" for every module, or "info,net=trace,net.http=off", a level for every module and one for each module named.
    • std.log.logger Logger, which writes lines for a module at levels, with fields, to a LogOutput: the default one, which writes readable lines to stderr at the levels FB_LOG sets, or one the program makes, with sinks of its own.
    • std.log.output What a Logger writes, and where: a LogRecord, with its LogFields, for each line, given to each sink of a LogOutput whose filter writes it.
    • std.log.sinks The sinks std.log has: the console's, which writes readable lines to stderr, colored on a terminal that shows colors, and JSON lines, one object a line, to what the program gives.

    std.events

    Event<T> and subscriptions that end with their owner.

    • std.events.event `Event<T>`: the handlers that an Emit calls, in the order they were added, held as a Field of what emits it, which holds them until they're cancelled.

    std.data

    JSON, MessagePack, TOML, CSV, INI, XML, YAML, and Protocol Buffers.

    • std.data.csv Csv: comma-separated values, as RFC 4180 has them: rows of fields, each line a row and its fields between separators, a field in '"'s when it holds the separator, a '"', or a line break, with its '"'s doubled.
    • std.data.ini Ini: INI files' sections of keys and values, read into an Object and written from one.
    • std.data.json JSON, as RFC 8259 has it: Json.Read reads a document into a Value, and Json.Write writes a Value as one; JsonReader reads a document's tokens one at a time, in order, and JsonWriter writes a document a token at a time, so neither holds more than the text.
    • std.data.msgpack MessagePack, as its spec has it: MessagePack.Read gives the Value of a document's bytes, and MessagePack.Write gives a Value's, each integer, string, and container in the fewest bytes its kind has.
    • std.data.protobuf Protocol Buffers' wire format, which the types fb makes from a .proto file read and write: ProtoWriter and ProtoReader, with varints, zigzag, fixed32 and fixed64 values, and length-delimited fields, ProtoText for a message's ToString, in protobuf's text format, and ProtoBox, which holds a message a message of its own type has.
    • std.data.text What std.data's formats share in reading and writing text: Strings from bytes, a text's code points as UTF-8, numbers as text and back, and where in a text a byte is, for a ParseError.
    • std.data.toml Toml: TOML 1.0's documents, read into an Object Value and written from one.
    • std.data.xml XML 1.0: a document's tree of XmlNodes, which Xml.Read builds over an XmlReader and Xml.Write writes over an XmlWriter, and Values to and from an element, as xmltodict has them: an element's attributes are keys with '@' before their names, its children keys of their names, an Array where a name comes more than once, and its text the key "#text", or the element's Value itself, a String, when it has neither attributes nor children.
    • std.data.xml_path XmlPath: XPath 1.0's location paths over an XmlNode's tree, a subset of them: steps on the child, descendant, descendant-or-self, parent, ancestor, ancestor-or-self, following-sibling, preceding-sibling, self, and attribute axes, written out or abbreviated ('//', '.', '..', '@'); tests of a name, '*', text(), node(), comment(), and processing-instruction(); and predicates of positions, paths, strings, and numbers, compared with =, !=, <, <=, >, and >=, joined with and and or, and the functions last(), position(), count(), not(), contains(), starts-with(), string(), name(), true(), and false().
    • std.data.xml_reader XmlReader: XML 1.0's documents read as a stream of events, a start and an end for each element and one for each run of text, CDATA section, comment, and processing instruction in them, as a non-validating processor reads them.
    • std.data.yaml Yaml: YAML 1.2's documents, read into Values by its core schema and written from them.
    • std.data.yaml_scanner YamlScanner: YAML 1.2's tokens, as libyaml scans them: indicators, scalars of each style, anchors, aliases, tags, and directives, and the block structure's starts and ends, which indentation gives, with a key's token put in front of a simple key once its ':' is found.

    std.crypto

    Hashes, HMAC, ciphers, signatures, key derivation, password hashing, PEM, and secure random.

    • std.crypto.blake3 Blake3, over BLAKE3's C code: a fast cryptographic hash of any length, 32 bytes unless asked for more or fewer, which can be keyed, as a MAC, or derive a key for a context, as a KDF.
    • std.crypto.checksums Crc32 and XxHash: fast checksums that aren't cryptographic.
    • std.crypto.ciphers Aes256Gcm and ChaCha20Poly1305, over mbedTLS: authenticated encryption, which keeps a message secret and tells whether it was changed.
    • std.crypto.derive Hmac, Hkdf, and Pbkdf2, over mbedTLS: a MAC, which a key makes and checks, a key from other key material, and a key from a password: HMAC and PBKDF2 by SHA-1, SHA-256, or SHA-512, and HKDF by SHA-256 or SHA-512.
    • std.crypto.hashes Md5, Sha1, Sha256, and Sha512, over mbedTLS: each one's Hash gives the hash of bytes, or of a String's bytes, at once, and an object of it adds them in turn.
    • std.crypto.passwords Argon2id and Bcrypt, for keeping passwords: Hash picks a new random salt and the parameters, and gives a String that has them with the hash, which is what to keep; Verify tells whether a password is the one a kept hash was made from.
    • std.crypto.pem Key and Certificate, which read keys and X.509 certificates from PEM, the text between "-----BEGIN ...-----" and "-----END ...-----" lines that keys and certificates are kept in, over mbedTLS.
    • std.crypto.random SecureRandom, bytes and numbers from the OS's randomness, through mbedTLS's generator, for keys, salts, nonces, and tokens; and ConstantTimeEquals, which compares secrets without telling where they differ.
    • std.crypto.signatures Ed25519, over Monocypher, and EcdsaP256, Rsa, and X25519, over mbedTLS: signatures, which a private key makes and its public key checks, and key exchange, which gives two sides one secret from their own private keys and each other's public ones.

    std.compress

    Deflate, Zstd, Lz4, XZ, and Zip, tar, and 7z archives.

    • std.compress.archive What Zip's, Tar's, and SevenZip's readers share: an ArchiveEntry for each of an archive's entries, in the order the archive has them, and how a name and a mode are checked before they're written.
    • std.compress.codec What std.compress's formats share: Coder, which each one's Compressor and Decompressor is; the most bytes a UInt8[] holds, which is a Decompress's limit unless it's given a smaller one; and the IOErrors the runtime's results mean.
    • std.compress.deflate Deflate (RFC 1951), Zlib (RFC 1950), and Gzip (RFC 1952), over zlib-ng.
    • std.compress.lz4 LZ4's frame format, of .lz4 files, over LZ4.
    • std.compress.seven_zip 7z's archives, read over liblzma: SevenZip.Read gives a SevenZipReader of a 7z's entries.
    • std.compress.stream std.compress over std.io's streams: a CoderWriter writes what's written to it through a Coder, like a GzipCompressor, to another Writer, and a CoderReader reads what another Reader gives through one, like a GzipDecompressor, so a file or a socket compresses and decompresses as it goes, a part at a time.
    • std.compress.tar Tar's archives: Tar.Read gives a TarReader of a tar's entries, and a TarWriter makes a new tar.
    • std.compress.vfs std.compress's zips in std.io's virtual file system: a ZipSource reads a zip's files as a VfsSource, and a Vfs's MountZip mounts one, as a game mounts its pak files.
    • std.compress.xz The .xz format, over liblzma: LZMA2, in streams with a CRC64 check.
    • std.compress.zip Zip's archives, over minizip-ng: Zip.Read gives a ZipReader of a zip's entries, and a ZipWriter makes a new zip of entries stored or compressed by Deflate, LZMA, XZ, or Zstd; every zip tool reads Deflate's, and newer ones the rest.
    • std.compress.zstd Zstd (RFC 8878), over zstd.

    std.net

    Addresses, DNS, TCP and UDP, TLS, an HTTP client and server, WebSockets, ACME, LAN discovery, and game networking.

    • std.net.acme std.net.acme: what automatic HTTPS needs of ACME (RFC 8555), as Let's Encrypt speaks it.
    • std.net.acme_client An ACME client (RFC 8555), as Let's Encrypt's are: AcmeClient makes an account with a CA, from its directory's URL, and orders a certificate for names it proves it holds by HTTP-01, publishing each challenge's key authorization through AcmeTokens, which a server answers on port 80 at /.well-known/acme-challenge/<token>.
    • std.net.address std.net's addresses: IpAddress, an IPv4 or IPv6 address, read from and written as its text, with what kind of address it is, and SocketAddress, one with a port, which sockets connect to and listen on.
    • std.net.dns std.net's Dns: the addresses a host's name has, as the OS's resolver finds them, through libuv's getaddrinfo on the runtime's I/O thread, blocking or Async.
    • std.net.game.channel std.net.game's channels: what each of a connection's channels does with its messages.
    • std.net.game.host std.net.game's hosts: GameHost, one end of any number of connections over a GameLink, a UdpSocket's or a test's, which it services at each Update, giving what happened as GameEvents: a peer that connected, a message that came, and a peer that disconnected.
    • std.net.game.link std.net.game's links: what a GameHost sends its packets over and takes them from.
    • std.net.game.packet std.net.game's packets as they go over the wire.
    • std.net.game.peer std.net.game's peers: the other side of a connection, as a GameHost has it.
    • std.net.game.settings std.net.game's settings, which a GameHost and its peers share, and why a connection ends.
    • std.net.http.client HttpClient, which sends HTTP and HTTPS requests and gives their responses, over libcurl, whose TLS is mbedTLS's: it follows redirects, decompresses what comes compressed, keeps cookies, and trusts the OS's roots unless it's given its own.
    • std.net.http.files Static files: a folder's files as a router's routes, for GET and HEAD, with their Content-Type, ETag, and Last-Modified, a 304 Not Modified for a request whose copy is current, and a 206 Partial Content for a request for one range of a file's bytes.
    • std.net.http.headers Headers, an HTTP request's or response's header fields: names, which ASCII's letter cases don't change, as "Content-Type" and "content-type" are one, each with its values, in the order they were added.
    • std.net.http.routes Routes from a Class's Methods: each Async Method with an attribute of its method and path, like `@Get("/users/:id")`, becomes a route, whose one argument, a Struct of what the request gives, is made from the route's path parameters, the query, and a JSON body, by `Load<T>`, as the command line's arguments are; a request whose values don't fit is a 400.
    • std.net.http.server HttpServer: HTTP/1.1 over TCP, or HTTPS, over TLS, whose handlers are Async code on the main thread, so they share its Globals without data races.
    • std.net.http.status StatusCode, the HTTP statuses a response can have, by their names in RFC 9110 and the RFCs it builds on, as `response.Status == StatusCode.NOT_FOUND` reads, with each one's reason.
    • std.net.http.wire std.net.http's wire: HTTP/1.1's messages as their bytes go, per RFC 9112.
    • std.net.http.work Work routes' threads: a blocking handler, which computes or waits, runs on one of a server's Workers threads, given a Sendable copy of its request, while the main thread goes on answering the others; what it gives goes back to the main thread as a Sendable copy too, which the connection's response is made from.
    • std.net.ipc std.net's IPC: IpcListener, which takes connections at a name, and IpcStream, a connection's bytes both ways, between programs on one machine.
    • std.net.lan std.net's LAN discovery: LanAnnouncer, which offers a service to the LAN, and Lan.Find, which finds those of a type there, over mDNS and DNS-SD (RFCs 6762 and 6763), as Bonjour and Avahi have them, so the dns-sd and avahi-browse tools find what a program offers, and it finds what they offer.
    • std.net.socket What std.net's sockets share: the runtime's functions, which work over libuv's handles on the I/O thread, an address as they pass it, a timeout as they take it, what their codes mean, and StreamSocket, which TcpStream and IpcStream read and write through.
    • std.net.tcp std.net's TCP: TcpListener, which takes connections at an address, and TcpStream, a connection's bytes both ways, a Reader and a Writer as std.io's streams are, each blocking or Async.
    • std.net.tls std.net.tls: TLS 1.2 and 1.3 over any stream that's a Reader and a Writer, as a TcpStream is, through mbedTLS.
    • std.net.udp std.net's UDP: UdpSocket, which sends and receives datagrams, each whole or not at all, in no promised order, blocking or Async, with broadcast and multicast for what's on the LAN.
    • std.net.url std.net's Url and QueryParams, as the WHATWG URL Standard has them: a URL read from its text, against a base or not, its parts and its origin, and the text it writes back, with what isn't in a part's set of code points percent-encoded; and a query's name and value pairs, as an HTML form sends them.
    • std.net.ws.handshake A WebSocket's opening handshake, per RFC 6455's section 4: the client's GET with Upgrade, and the server's 101 with the key's answer, over HTTP/1.1's wire.
    • std.net.ws.websocket std.net.ws's WebSocket, per RFC 6455: messages of text or bytes both ways over one connection, a client's from Connect, at a ws:// URL, or a wss:// one over TLS, or a server's from Accept, which answers the client's handshake.

    std.db

    SQLite databases, and Query<T> over their rows.

    std.image

    PNG, JPEG, GIF, WebP, SVG, and HDR images, drawing on a canvas, and fonts.

    • std.image.animation Animation: frames of one size, each an Image shown for its delay, played a number of times or forever, which Gif's and Png's DecodeAnimation give and their EncodeAnimation take.
    • std.image.bitmap The formats of plain bitmaps: BMP and TGA, as stb_image reads and stb_image_write writes them, and QOI, the Quite OK Image format, which the runtime reads and writes itself.
    • std.image.canvas Canvas: drawing on an Image, through the runtime's fb_image_ functions.
    • std.image.codec What std.image's formats share: the most pixels an Image holds, which a Decode's limit is unless it's given a smaller one, the images the runtime's decoders give, the IOErrors their results mean, and the checks of what the encoders take.
    • std.image.font Font: a TrueType or OpenType font, read by the runtime itself, which checks each offset in it before it follows it, so a broken font or one made to mislead is an IOError, or draws boxes, but never reads past its bytes: its glyphs' outlines, TrueType's, simple and composite, or CFF's, cmap's formats 4 and 12, and kern's kerning, from bytes or a file.
    • std.image.gif GIF, read and written by the runtime itself: Gif.Decode reads a GIF's first frame, and DecodeAnimation every frame, each as it's shown once the frames before it are, drawn as browsers draw them, on a canvas that starts transparent.
    • std.image.hdr HDR: an HdrImage's pixels are light, linear, each RGBA as Floats, past 1 where they're brighter than white, in a `Buffer<Float32>`, which Hdr reads from Radiance's RGBE files, as stb_image reads them, and writes to them, run-length encoded, as stb_image_write does.
    • std.image.image Image: a picture's pixels, in rows from the top, each RGBA, 8 bits a channel, its alpha straight, in a `Buffer<UInt8>`, which C code can read and write through its Pointer, and which the formats' Decodes give and their Encodes take.
    • std.image.jpeg JPEG: Jpeg.Decode reads baseline and progressive JPEGs, gray, YCbCr, and CMYK, as stb_image reads them, and Encode writes a baseline one at a quality, as stb_image_write does, without the image's alpha, which JPEG doesn't have.
    • std.image.png PNG, and APNG, its animation: Png.Decode reads any PNG, of every color type and bit depth, interlaced or not, as stb_image reads them, and Encode writes one, 8 bits a channel, RGB when every pixel is opaque and RGBA when one isn't, deflated by zlib-ng at a level.
    • std.image.svg SVG, over nanosvg: Svg.Parse reads an SVG's shapes, paths, strokes, fills, and gradients into an Svg, whose Width and Height are its size in pixels at 96 dots an inch, and Rasterize draws it into an Image, its edges antialiased.
    • std.image.webp WebP, over libwebp: WebP.Decode reads a still WebP, lossy or lossless, with or without alpha, and Encode writes a lossy one at a quality, and EncodeLossless a lossless one at an effort, which keeps every pixel as it is, the colors of transparent ones too.

    std.term

    Terminal styles, input, prompts, screens, and widgets.

    • std.term.console The console: whether stdin, stdout, and stderr are terminals, the terminal's size, and a key or a password read from it, over the runtime's fb_term_ functions, which put the console back as the program ends, however it ends.
    • std.term.input std.term's input: what a terminal sends as keys are typed and the mouse moves, its bytes as they come, which an InputParser turns into InputEvents: keys, with xterm's sequences for the keys that type no character, and the modifiers held with them; the mouse's reports, in SGR's form or the older X10 one; and what's pasted between bracketed paste's marks.
    • std.term.prompts std.term's prompts: Confirm asks yes or no, Choose for one of some options, and Ask for a line of text, on the console or on a Terminal given.
    • std.term.region std.term's regions: a Region of a screen's cells, which splits into rows or columns by Constraints, as a full-screen app lays out its panes: a size that's Fixed, a Percent of what there is, at least a Min, or a share of what's left, Fill.
    • std.term.screen std.term's full-screen apps: a Screen takes the whole terminal, on its alternate screen, in raw mode, with the cursor hidden, and shows a Canvas of cells there, writing only the cells that changed since it last did.
    • std.term.style std.term's styles: a TermColor for text, one for what's behind it, and TextAttributes, in a Style, which a terminal shows through the escape codes Apply writes, in as many colors as it shows, the nearest of them where it shows fewer.
    • std.term.terminal A Terminal: where line widgets and full-screen apps write, and keys come from.
    • std.term.views std.term's views for full-screen apps, each drawn on a Canvas in a Region, which take the keys and the mouse's events that are theirs: a TextInput, a line of text that's edited as a shell's is, and a ListView, a list of items with one selected, which scrolls to keep it in view.
    • std.term.widgets std.term's line widgets: a Table and a Box, which give their text, and a ProgressBar and a Spinner, which draw themselves on a terminal's line again as they go, where it's interactive, and once they're done where it isn't, as for a pipe or a file.

    std.algo

    Graph search, topological order, combinatorics, Delaunay triangulation, union-find, and grids.

    • std.algo.combinatorics Permutations and Combinations: every order, or every choice, of an array's elements, made one at a time as a For ...
    • std.algo.delaunay Delaunay triangulation and Voronoi diagrams of points in 2D, and Lloyd relaxation, which moves points apart until they're evenly spread, for maps, meshes, and placing things.
    • std.algo.grid Searches on grids of cells, each a Vec2i from (0, 0) to (width - 1, height - 1): the cells next to one, the path between two by A*, and flow fields, which give every cell its way to the nearest goal at once, for many agents going to the same places.
    • std.algo.search std.algo's searches of graphs: breadth-first and depth-first search, Dijkstra, and A*.
    • std.algo.topological TopologicalSort and FindCycle: an order of nodes where each comes before the nodes it leads to, as build steps, dependencies, and a tech tree need, and the cycle that keeps there from being one.
    • std.algo.union_find UnionFind: the Ints from 0 to Count - 1 in sets that start one to each and only ever join, for what's connected to what, as Kruskal's spanning tree and a map's regions ask.

    std.uuid

    UUIDs, RFC 9562's.

    • std.uuid.uuid Uuid, RFC 9562's 128-bit identifiers: V4 makes a random one, from SecureRandom, and Parse reads the text ToString writes, the 16 bytes as 32 hex digits in groups of 8, 4, 4, 4, and 12, like "f81d4fae-7dec-11d0-a765-00a0c91e6bf6".

    std.debug

    Whether a debugger is attached, and breakpoints.

    • std.debug.debugger Breakpoint and IsDebuggerAttached, for a program's own debugging: a breakpoint written in its code, which stops in the debugger that's attached, and asking whether one is.

    std.test

    Expect, ExpectThrows, Fail, and Skip, which fb test runs.

    • std.test std.test: what fb test runs and checks with.

    std.ffi

    CData, Buffer, Mem, and CStrings, for C libraries.

    • std.ffi.buffer `Buffer<T>`: native memory of C's values at an address that doesn't move, which C code reads and fills through its Pointer and safe code reads and sets with [], each index checked against its Count, so std.io and C libraries share memory with safe code without copying it.
    • std.ffi.cdata CData: the constraint for the types C code has, which a Ptr points to and SizeOf measures.
    • std.ffi.cstring What a CString does besides ToString, which is built in: a copy of a String that C code can keep, its length, and giving the copy back.
    • std.ffi.mem Raw memory, which Unsafe code allocates, resizes, fills, copies, compares, and gives back, through the runtime, whose C functions a program can declare as it likes.

    Report an issue with this page or with FutureBlitz on GitHub.