std Is the Core the Language Stands On; Formats and Protocols Are Official Packages, Versioned on Their Own and Taken in by Their First useStatus: Accepted
Date: October 9, 2026 (#539)
Answers: what belongs in std, and where a format or a protocol a program
needs every day goes instead
Related:
ADR-286 D23-D26 (a published package x is the crate nikaia_x),
D19 (a dependency is a crate of its own);
ADR-336 D2 (every crate the project publishes takes the prefix);
ADR-002 D4 (std is compiled once per machine);
Part III 17
Does std hold the formats and protocols a program uses every day (JSON,
TOML, CSV, HTML, HTTP), or only what the language itself stands on?
Part III 17 calls std “batteries included” and already lists std::html,
std::http1 and std::json; nobody decided that it should. What is in std
moves with the language’s version: once the language is stable, a module there
can no longer change incompatibly, and a mistake in its API stays.
| Language | std |
What came of it | Source |
|---|---|---|---|
| Python | large | some twenty modules removed as dead (PEP 594); urllib displaced in practice by requests, never in std |
from memory, not checked |
| Java | large | java.util.Date kept for compatibility; java.time years later |
from memory, not checked |
| Go | net/http, encoding/json, csv |
works; encoding/json’s faults stood for years until a second version |
from memory, not checked |
| Rust | minimal | formats and protocols in crates; freedom, and the cost of choosing among them | from memory, not checked |
| Deno | @std/json, @std/csv, @std/toml |
maintained by the project, each versioned on its own | from memory, not checked |
| Kotlin | small, plus kotlinx |
official libraries, versioned on their own | from memory, not checked |
std::html or
std::http1; with html::escape it has one, and 2 244 bytes more. Size is no
argument either way.std is compiled once per machine (ADR-002 D4); a package is compiled in
each project, where Cargo’s cache keeps it.std is the core the language stands on.Input and output, files, text, collections, tasks and their channels, locks,
processes, time, the command line, numbers, and what grammars and build-time
code need from a library. A module is in std because the language cannot be
used without it, not because many programs want it.
JSON, TOML, CSV, HTML, HTTP/1.1’s text half and the database protocol are
packages json, toml, csv, html, http1 and db: maintained in this repository, shipped with the
toolchain so they work offline, each with a version of its own, and published
as every package is, nikaia_json and the rest (ADR-286 D23, ADR-336 D2).
std lists the official packages, and a use of one takes it in.std carries the list of official packages and the version of each that this
toolchain ships. use json where neither [dependencies] nor a directory of
the project (ADR-286 D37) names json takes in the official package at the
listed version, recorded in nikaia.lock; a [dependencies] entry names
another version. A name that is neither declared nor on the list is refused as
before.
What the toolchain writes in Nikaia and needs a format for, reading
nikaia.toml, depends on the official package; it is not a reason for the
format to be in std.
json, toml and csv each read a text into values and write values into a
text. Writing makes a new text from a value; editing an existing text while
keeping its comments and order is not part of this.
Why. A format or a protocol is where APIs are most often got wrong and most
often outgrown; versioned on its own, a second version is a release and not a
compatibility break of the language. Taken in by its first use, an official
package costs a program nothing to reach, so it loses nothing against being in
std.
std::html, std::http1 and std::db, which exist, become the packages
html, http1 and db. db has no place in the compiler that a format
lacks: what a dsl block does with a driver’s grammar it does with json’s; std::json, which is named and not built, is built as json.
ADR-017 and ADR-289 name them under std:: and
read now as these packages.std is the one place that says which names are official; a
user’s package under one of those names is refused on crates.io by the
project publishing it first.nikaia.toml would want.