The standard library
206 modules in twelve areas, written in FutureBlitz, each documented from its own doc comments.
A program imports what it uses: Import std.core brings in Print, Error, and the Interfaces, and importing a
folder, like Import std.collections, brings in each of its modules. A program gets only the library code it
uses, and the C libraries std builds on link in statically, only when a program calls them.
Core
Print and Input, errors, iterators, formatting and parsing, events, logging, and tests.
-
std.core.assertAssertEqual, an Assert that says what it compared. -
std.core.errorError, the Class every error extends, and each area's own Error. -
std.core.formatFormatting by a template the program has only when it runs, and the debug form. -
std.core.interfacesThe Interfaces that operators and string conversion work through. -
std.core.iteratorIterators, and the Iterable Interface, which For loops go over besides arrays. -
std.core.loadThe attributes and Interfaces that change how Load and Save convert a type. -
std.core.parseParsing numbers and Bools from text. -
std.core.printWriting to stdout and stderr, and reading lines from stdin. -
std.core.rangeRanges of integers, as For loops count them. -
std.core.valueValue, data of any shape, as the data formats read and write it. -
std.core.valuesMin, Max, Clamp, Swap, and HashCombine, for any values. -
std.events.eventEvents, which call the handlers subscribed to them when they're emitted. -
std.log.filesLog sinks that write to files, rotated or not. -
std.log.levelLog levels, and the filter that picks each module's least level. -
std.log.loggerLogger, which writes a module's lines, with levels and fields. -
std.log.outputWhat a Logger writes, and the output that hands it to sinks. -
std.log.sinksLog sinks for the console and for JSON lines. -
std.testExpect, ExpectThrows, Fail, and Skip, what fb test's tests check with. -
std.debug.debuggerBreakpoints in code, and whether a debugger is attached.
Collections
Map, Set, Stack, Queue, Deque, PriorityQueue, caches, and graph and grid algorithms.
-
std.collections.arraySearching, sorting, reshaping, and the other Methods every array has. -
std.collections.bit_setA set of Ints from 0 up, a bit each. -
std.collections.counterA count of how many times each value was added. -
std.collections.dequeA double-ended queue, which adds and takes values at either end. -
std.collections.gridFixed-size 2D and 3D grids of values, read and set by position. -
std.collections.immutableArrays, maps, and sets that never change, so any thread can read them. -
std.collections.interval_treeA tree of values over intervals, which finds those that overlap an interval or hold a key. -
std.collections.linked_listA doubly linked list, which adds and removes values beside a node in constant time. -
std.collections.lru_cacheA cache of up to a set number of entries, which drops the one used least recently. -
std.collections.mapA hash map that keeps its entries in the order they were added. -
std.collections.multi_mapA map from each key to one value or more. -
std.collections.poolValues kept by Handles, which find nothing once their value is removed. -
std.collections.priority_queueA priority queue, whose Pop gives the value that comes first. -
std.collections.queueA first-in, first-out queue. -
std.collections.ring_bufferA fixed number of the last values added, oldest first. -
std.collections.setA set of values without repeats, in the order they were added. -
std.collections.sortedA map and a set that keep their keys in order, in a B-tree. -
std.collections.spatialSpatial hashes, quadtrees, and octrees, which find values by where they are. -
std.collections.stackA last-in, first-out stack. -
std.collections.trieA prefix tree of String keys, which finds the keys that start with a prefix. -
std.collections.viewViews of arrays, maps, and sets, which show them without copying. -
std.algo.combinatoricsEvery order and every choice of an array's elements, and how many of each there are. -
std.algo.delaunayDelaunay triangulation, Voronoi diagrams, and Lloyd relaxation of points in 2D. -
std.algo.gridNeighbors, A* paths, and flow fields on grids of cells. -
std.algo.searchBreadth-first search, depth-first search, Dijkstra, and A* over any graph. -
std.algo.topologicalTopological sorting of a graph's nodes, and finding the cycle that keeps one from being. -
std.algo.union_findDisjoint sets of Ints that only ever join, for what's connected to what.
Text
Unicode, regular expressions, Markdown, templates, diffs, fuzzy matching, and encodings.
-
std.text.builderStringBuilder, which builds text a piece at a time. -
std.text.charA Char's code, kind, and case. -
std.text.diffThe differences between two texts, by lines or characters, and three-way merges. -
std.text.encodingText encodings, Base64, hex, and Base32, and escaping text for URLs, HTML, and string literals. -
std.text.fuzzyFuzzy matching of text, as fzf does it. -
std.text.globMatching text against a shell's wildcard patterns. -
std.text.humanizeNumbers, sizes, times, and names written as people say them, in English. -
std.text.layoutWrapping, dedenting, and indenting a String's lines, and the edit distance between two. -
std.text.markdownCommonMark Markdown, as HTML or as a tree. -
std.text.regexRegular expressions, by PCRE2. -
std.text.scannerScanner, which reads text a piece at a time, for a parser. -
std.text.stringSearching, slicing, splitting, and changing Strings. -
std.text.templateMustache-style templates, filled from Values and other types. -
std.text.unicodeWhat Unicode says of characters: categories, normal forms, case folding, and widths.
Data formats
JSON, MessagePack, TOML, CSV, INI, XML, YAML, Protocol Buffers, and SQLite databases.
-
std.data.csvReading and writing comma-separated values. -
std.data.iniReading and writing INI files. -
std.data.jsonReading and writing JSON. -
std.data.msgpackReading and writing MessagePack. -
std.data.protobufProtocol Buffers' wire format and text format, for the types made from .proto files. -
std.data.textWhat std.data's formats share in reading and writing text. -
std.data.tomlReading and writing TOML. -
std.data.xmlReading and writing XML documents, as trees and as Values. -
std.data.xml_pathXPath's location paths over an XML document's tree. -
std.data.xml_readerReading XML as a stream of events. -
std.data.yamlReading and writing YAML. -
std.data.yaml_scannerYAML's tokens, as a scanner reads them from text. -
std.db.databaseSQLite databases: statements, queries, transactions, and migrations.
Files and streams
Paths, files, folders, streams, memory-mapped files, a virtual file system, and file watching.
-
std.io.binaryReading and writing numbers, Bools, bytes, and text in binary, in either byte order. -
std.io.bufferedBuffered readers and writers over other streams. -
std.io.dirMaking, listing, and removing folders, and finding paths by glob patterns. -
std.io.fileReading, writing, copying, moving, and deleting whole files at once. -
std.io.file_streamOpen files, which read, write, and seek as streams. -
std.io.lockLocks on files, which other programs see. -
std.io.mappedFiles mapped into memory, read and written in place. -
std.io.memoryStreams over bytes and Strings in memory. -
std.io.pathPaths of files and folders, by Windows' rules or POSIX's. -
std.io.preferencesA program's settings, kept between its runs where the OS keeps them. -
std.io.requestWhat std.io's file calls share. -
std.io.streamsReader, Writer, and Seeker, the streams that files and sockets are, and copying between them. -
std.io.tempTemporary files and folders, removed when they're closed. -
std.io.vfsA virtual file system of folders, embedded files, and zips, mounted in one tree. -
std.io.watcherWatching files and folders for changes.
Networking and HTTP
Addresses, DNS, TCP and UDP, TLS, an HTTP client and server, WebSockets, and ACME.
-
std.net.acmeWhat automatic HTTPS needs of ACME, as Let's Encrypt speaks it. -
std.net.acme_clientAn ACME client, which gets certificates from a CA like Let's Encrypt. -
std.net.addressIP addresses, and socket addresses with ports. -
std.net.dnsLooking up the addresses a host's name has. -
std.net.game.channelWhat each channel of a connection does with its messages. -
std.net.game.hostGameHost, one end of any number of connections, which reports what happens as events. -
std.net.game.linkWhat a GameHost sends its packets over, and receives them from. -
std.net.game.packetThe packets a GameHost sends, as they go over the wire. -
std.net.game.peerThe other side of a connection, as a GameHost has it. -
std.net.game.settingsThe settings a GameHost and its peers share, and why a connection ends. -
std.net.http.clientAn HTTP and HTTPS client. -
std.net.http.filesServing a folder's files over HTTP. -
std.net.http.headersHTTP header fields, whose names match in any letter case. -
std.net.http.routesRoutes made from a Class's Methods, by attributes like @Get. -
std.net.http.serverAn HTTP and HTTPS server, whose handlers run on the main thread. -
std.net.http.statusHTTP status codes and their reasons. -
std.net.http.wireHTTP/1.1 messages as their bytes go over the wire, per RFC 9112. -
std.net.http.workBlocking route handlers, run on a server's worker threads. -
std.net.ipcConnections between programs on one machine. -
std.net.lanOffering and finding services on the LAN, over mDNS and DNS-SD. -
std.net.socketWhat std.net's sockets share. -
std.net.tcpTCP connections and listeners. -
std.net.tlsTLS 1.2 and 1.3 over any stream. -
std.net.udpUDP sockets, with broadcast and multicast. -
std.net.urlURLs and query strings, as the WHATWG URL Standard has them. -
std.net.ws.handshakeA WebSocket's opening handshake, over HTTP/1.1. -
std.net.ws.websocketWebSocket clients and servers.
Concurrency
Locks, concurrent maps and queues, lazy values, parallel algorithms, and cancellation.
-
std.concurrent.cancellationA flag that stops blocking calls and work under way, on any thread. -
std.concurrent.channelsWaiting on several Channels at once, and Channel waits that a Cancellation stops. -
std.concurrent.concurrent_mapA hash map that any number of threads read and change at once. -
std.concurrent.concurrent_queueA first-in, first-out queue for any number of threads at once. -
std.concurrent.lazyA value made once, the first time any thread asks for it. -
std.concurrent.locksSemaphores, barriers, wait groups, Once, and read-write locks, for any thread. -
std.concurrent.parallelParallel ForEach, Map, Reduce, and Sort over arrays, on the job pool. -
std.concurrent.tasksCombining Tasks, and finishing a Task by hand.
Math
Vectors, matrices, colors, geometry, random numbers, noise, statistics, units, and big numbers.
-
std.math.big.bigintIntegers of any size. -
std.math.big.complexComplex numbers, as two Doubles. -
std.math.big.decimalDecimal numbers, which hold decimal fractions like 0.1 exactly. -
std.math.big.rationalExact fractions of BigInts. -
std.math.bitsCounting, rotating, swapping, and aligning an integer's bits, and saturating arithmetic. -
std.math.colorColors, as sRGB bytes and as linear Floats. -
std.math.constantsMath's constants, like Pi and E, as Floats and as Doubles. -
std.math.curvesBezier curves, splines, and paths through points, in 2D and 3D. -
std.math.easingEasing curves for animation, from 0 at the start to 1 at the end. -
std.math.fixedFixed-point numbers, whose math gives the same bits on every OS and CPU. -
std.math.geometryRectangles, boxes, spheres, rays, planes, and frustums, and the tests between them. -
std.math.int_vectorInteger 2D and 3D vectors, for grid cells and the steps between them. -
std.math.matrix3x3 and 4x4 matrices of Floats, column-major, as the GPU takes them. -
std.math.noisePerlin, Simplex, value, and cellular noise, and fractal Brownian motion. -
std.math.numbersThe Interfaces the number types share, for generic math: Bounded, Integer, and FloatingPoint. -
std.math.polygonPolygons: their areas, hulls, triangles, and the union, intersection, and difference of two. -
std.math.quatQuaternions, for rotations in 3D. -
std.math.randomA seeded random number generator that gives the same numbers on every platform. -
std.math.scalarMath on single numbers: signs, rounding, remainders, powers, logs, and trigonometry. -
std.math.statsStatistics: mean, median, variance, standard deviation, percentiles, and histograms. -
std.math.unitsQuantities with units of length, mass, and time, which the compiler keeps apart. -
std.math.vector2D, 3D, and 4D vectors of Floats.
Time
Durations, timestamps, dates and times of day, calendars, timers, and time zones.
-
std.time.calendarDates, times of day, and the two together, without a time zone. -
std.time.clockThe monotonic clock, for measuring how long things take, and Sleep. -
std.time.durationDurations, spans of time to the nanosecond. -
std.time.formatFormatting and parsing dates and times: ISO 8601, RFC 2822, and patterns. -
std.time.timersTimers, deadlines, fixed steps, rate limits, and debouncing. -
std.time.timestampTimestamps, points in time in UTC, to the nanosecond. -
std.time.zoneTime zones, and times in them: the IANA database's, fixed offsets, and the OS's.
Crypto and compression
Hashes, ciphers, signatures, password hashing, UUIDs, and Deflate, Zstd, Zip, and tar.
-
std.crypto.blake3The BLAKE3 hash, also keyed, as a MAC, and as a key derivation function. -
std.crypto.checksumsCRC-32 and XXH3, fast checksums that aren't cryptographic. -
std.crypto.ciphersAuthenticated encryption, by AES-256-GCM and ChaCha20-Poly1305. -
std.crypto.deriveHMAC, HKDF, and PBKDF2: message authentication and key derivation. -
std.crypto.hashesThe MD5, SHA-1, SHA-256, and SHA-512 hashes. -
std.crypto.passwordsHashing and checking passwords, by Argon2id and bcrypt. -
std.crypto.pemReading keys and X.509 certificates from PEM, and writing keys to it. -
std.crypto.randomRandom bytes and numbers from the OS, for secrets, and comparing secrets in constant time. -
std.crypto.signaturesSignatures and key exchange: Ed25519, ECDSA P-256, RSA, and X25519. -
std.compress.archiveThe entries that the zip, tar, and 7z readers give. -
std.compress.codecWhat std.compress's formats share: the Coder Interface, limits, and errors. -
std.compress.deflateDeflate, Zlib, and Gzip compression. -
std.compress.lz4LZ4 compression, in its frame format. -
std.compress.seven_zipReading 7z archives. -
std.compress.streamCompressing and decompressing streams as they're written and read. -
std.compress.tarReading and writing tar archives. -
std.compress.vfsZips mounted in std.io's virtual file system. -
std.compress.xzThe .xz compression format. -
std.compress.zipReading and writing zip archives. -
std.compress.zstdZstandard compression. -
std.uuid.uuidUUIDs: random version 4 identifiers, and their text.
Images and the terminal
PNG, JPEG, GIF, WebP, and SVG images, drawing and fonts, and terminal styles, input, and widgets.
-
std.image.animationAnimations: frames of Images, each shown for a time. -
std.image.bitmapBMP, TGA, and QOI images. -
std.image.canvasDrawing lines, shapes, paths, images, and text on an Image. -
std.image.codecWhat std.image's formats share: limits, decoded images, and errors. -
std.image.fontTrueType and OpenType fonts, read safely from bytes or a file. -
std.image.gifReading and writing GIF images and animations. -
std.image.hdrHigh dynamic range images, and Radiance's HDR files. -
std.image.imageImage, a picture's RGBA pixels in memory, and what changes them. -
std.image.jpegReading and writing JPEG images. -
std.image.pngReading and writing PNG images and APNG animations. -
std.image.svgReading SVG images and drawing them into Images. -
std.image.webpReading and writing WebP images. -
std.term.consoleThe console: whether its streams are terminals, its size, and reading keys and passwords. -
std.term.inputTurning what a terminal sends into key, mouse, and paste events. -
std.term.promptsAsking yes or no, for one of some options, or for a line of text. -
std.term.regionLaying out a screen's cells in rows and columns. -
std.term.screenFull-screen terminal apps, which draw only the cells that changed. -
std.term.styleColors and text attributes for what a terminal shows. -
std.term.terminalA Terminal, where widgets and full-screen apps write and keys come from. -
std.term.viewsText inputs and list views for full-screen terminal apps. -
std.term.widgetsTables, boxes, progress bars, and spinners for a terminal's lines.
OS and processes
Command-line arguments, the environment, standard folders, processes, signals, and C data.
-
std.os.argsReading a program's command line into a Struct or Class. -
std.os.envThe environment's variables, and loading them from .env files. -
std.os.foldersWhere the OS keeps the user's and the program's files, and opening a file in its app. -
std.os.processThe program's own process: its Id, and ending it. -
std.os.process_childA running child process: its streams, waiting for it, and ending it. -
std.os.process_commandStarting other programs, with their arguments, environment, and streams. -
std.os.process_signalsHandling the interrupt and terminate signals. -
std.os.systemWhat the program knows of the machine it runs on. -
std.ffi.bufferNative memory of C values, which C code and safe code share without copying. -
std.ffi.cdataCData, the constraint for the types C code has. -
std.ffi.cstringCStrings that C code can keep: copies of Strings, their lengths, and freeing them. -
std.ffi.memRaw memory for Unsafe code: allocating, copying, filling, comparing, and freeing it.
Report an issue with this page or with FutureBlitz on GitHub.