@section{Part III — The standard library} A short tour of the standard library. Each module's full reference is its own page under @link["modules/index.html"]{Modules}; the prelude's is still @code{Docs/prelude.org}. @subsection{std/fmt} Formatting in Bjolang is divided into two layers: interpolation and layout. Interpolation provides a simple way to combine mixed scalar types into strings or print them directly using @code{println*} and @code{str*}. The layout layer provides a composable block algebra for more complex text formatting, such as padding, aligning, wrapping paragraphs, and laying out tables. For more details, see @link["modules/std/fmt.html"]{@code{(std fmt)}}. @subsection{std/rx} Bjolang provides a built-in regular expression engine. Unlike languages that use strings for regex (like @code{"[a-z]+"}), Bjolang uses structural S-expressions. This means you never have to double-escape characters, and the compiler validates your patterns at compile time. Built-in character sets and anchors are written as keywords (e.g., @code{:bos}, @code{:digit}), and operations that group or repeat patterns are function-like lists (e.g., @code{(seq ...)}). For more details, see @link["modules/std/rx.html"]{@code{(std rx)}}. @subsection{std/http} The @code{std/http} module allows you to build and send HTTP requests. Sending a request three ways — blocking, suspending, or as an event — is the only thing that differs between the entry points. There is no C# in this module: @code{System.Net.Http} is reached with @code{import/extern}, and the response body is an ordinary @code{TextInputPort}. For more details, see @link["modules/std/http.html"]{@code{(std http)}}. @subsection{std/run} The @code{std/run} module provides a way to run external programs. A form is one thing to run, written as a quoted literal, like @code{'(cat "hej.txt")}. You can connect programs in a pipe with @code{'(pipe (cat "a") (wc -l))}, and redirect input and output to files. Redirections can nest, and you can even splice computed arguments or write stages in Bjolang. For more details, see @link["modules/std/run.html"]{@code{(std run)}}. @subsection{std/random} The random module provides a ChaCha20 generator, seeded with 256 bits from the OS CSPRNG, with one generator per thread. The default path locks nothing and shares nothing, making it safe and fast on a bjoroutine. The ambient source has no state to race on, so drawing from multiple threads is efficient. You can generate random integers and more. For more details, see @link["modules/std/random.html"]{@code{(std random)}}. @subsection{std/datetime} This module provides types and functions for handling time. The clock is an argument (with a default that a program can rebind), and the types refuse operations that mean nothing, such as adding a calendar day to an instant. The module separates @code{Date} (a calendar date without a timezone), @code{Time} (a time of day without a timezone), and @code{DateTime} (a date and time without a timezone), as well as handling timezones. For more details, see @link["modules/std/datetime.html"]{@code{(std datetime)}}. @subsection{text/bjodat} bjodat is Bjolang's shapes read as data: no evaluation, no macro expansion, no environment. It is what a package manifest, a lockfile, or a config file is written in. You can parse text straight into a record using @code{bjodat-parse-}, which avoids intermediate trees and allocations. For more details, see @link["modules/text/bjodat.html"]{@code{(text bjodat)}}. @subsection{text/json} The @code{text/json} module provides JSON parsing and generation capabilities. Like @code{bjodat}, it allows for working with structured data but using the standard JSON format, which is essential for web communication. For more details, see @code{prelude.org} and related standard library documentation.