Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Standard library scope

Status: Partly implemented. The standard library reference owns the shipped contracts: collections, text/data formats, files/processes, streams, networking, TLS, HTTP clients/servers and helpers, crypto, SQLite, logging, signals, and testing. The catalogue below is the original scope, not a list of modules still missing. Issue #49 retains the original catalogue and rationale; it is closed by decomposition, not implementation. Remaining delivery is recorded only in backlog B38–B70. Module names and unimplemented signatures remain design candidates. This page adds no language syntax or runtime API.

The goal is useful CLI/data tools and network services without third-party application packages. Python’s library breadth and Go’s combined HTTP client/server scope motivated issue #49; compatibility with their APIs is not a requirement. A production HTTP server remains an explicit bundled-library goal, with separate acceptance criteria.

Boundaries

Keep the prelude small and import larger facilities under std. Ship source and approved native dependencies with the matching toolchain; ordinary builds must import the library offline after installation or relocation. Importing an unused module must not impose unrelated backend/linker requirements on a program. Issue #45 continues to own package distribution, manifests and project commands.

Ordinary algorithms, containers, parsers, routing and policy belong in checked Plenty source. Standard imports pass the same ownership and worker-effect checks as user modules. Runtime boundaries cover allocation, handles/syscalls, clocks, entropy, sockets/polling, native synchronization and approved bindings. Reuse maintained TLS/crypto, SQLite and suitable compression/math primitives; record backend versions, licenses, supported targets and update responsibility. Plenty or native sets when a native library is chosen. Library purity must not weaken correctness or security.

Current support is x86_64 Linux GNU. Lossless Linux Path and list[u8] binary transport have shipped; neither is a portable path abstraction or compact byte view. Further target support requires explicit platform contracts and tests.

Plenty or native

Write a std module in Plenty unless a native library is clearly better: cryptography, a large established engine, or performance the compiler cannot reach. A Rust crate named in an issue is a reference for API and test vectors unless the issue makes that case. Issue #505 records this decision.

Plenty code costs less in an executable:

  • Removal. Emission drops unreachable std functions one at a time before native code is generated (issue #400), and release builds substitute small leaf functions at the call site (issue #363). Native runtime code is removed only at link time, by --gc-sections, and only when nothing kept still calls it. A central runtime dispatcher keeps every operation it can reach (issue #501).
  • Allocation failure. Plenty code reports it as AllocError by construction. A wrapped crate must be checked, since Rust’s global allocator aborts on failure. rustls is the recorded exception (std.tls costs); new wrappers get none.

A native wrapper must:

  • report allocation failure as AllocError, through a fallible interface or a caller-supplied allocator, as zlib-rs does for std.compress. If the crate cannot, write the needed part in Plenty instead;
  • give each operation its own runtime entry symbol, as the std.crypto digests have, so the linker drops what a program does not call;
  • add no case to a shared runtime dispatcher;
  • add a row to NATIVE_MODULES in tests/test_executable_size.rs, which checks that hello links none of the wrapper’s code and a program using it does (size budgets);
  • when large, ship as a separate engine needed only by programs that import it, following the engine contract that the std.dataframe engine uses.

Module implementation choices

The policy applied to issues #461–#499. “Decide” means the issue settles the choice with a measurement or allocation check before implementation.

IssueModuleChoiceReason
#461std.uuidPlentyImplemented: byte formatting over std.secrets and std.time
#462std.xmlPlentyImplemented bounded UTF-8 event reader/writer; no DTDs or external entities. Pure Plenty keeps allocation failures explicit.
#463Time zonesPlentyPackage; packages carry only Plenty source
#464AEAD, signatures, key exchangeNativeCryptography; ring is already linked for std.tls
#465Unicode segmentationPlentyPackage; generated tables
#466, #467WebSocketPlentyFraming over std.http and std.tls
#468Server-Sent EventsPlentyText encoding over a response stream
#469std.diffPlentyMyers and patience are short algorithms over lists
#470std.markdownPlentyParser and renderer; pulldown-cmark allocates infallibly
#472User directoriesPlentyXDG rules over std.env
#473SHA-1NativeCryptography; RustCrypto sha1 allocates nothing, like sha2
#474Bytes.find_bytesNativeSIMD search the compiler cannot match; memchr allocates nothing
#475std.toml editsPlentystd.toml is Plenty; toml_edit allocates infallibly
#476std.imagePlentyImplemented: PNG decoding and encoding over std.compress, crop, conversion and resize, with limits checked before allocating; image allocates infallibly. JPEG, GIF and WebP deferred
#477Progress barPlentyTerminal drawing over std.io
#478std.shlexPlentySmall tokenizer
#480std.memmapPlentyA few system calls behind small runtime entries
#481std.bigintDecideMeasure Plenty limb arithmetic against native call cost; num-bigint allocates infallibly
#482LRU cachePlentydict and std.deque
#483BLAKE3NativeCryptography with SIMD; confirm hashing allocates nothing
#484inotifyPlentyA few system calls behind small runtime entries
#485std.mimePlentyParsing and a lookup table
#486std.graphPlentyUser data on nodes and edges; algorithms over lists
#487System informationPlentyText files under /proc and /sys
#488std.jwtPlentyComposes std.json, std.encoding and std.crypto
#489base32PlentySame as the existing codecs
#490Linear algebraNativeLarge engine with SIMD kernels; separate engine; check faer allocation first
#491BrotliNativeLarge codec; the brotli crate takes an allocator, so failure is reported
#492OptimizationPlentyClosed; replaced by the numerics core proposal: solvers in Plenty over std.linalg
#493numeris evaluationPlentyClosed; not adopted; std.linalg keeps faer
#494StatisticsPlentyFormulas over lists; sampling keeps std.random’s stable sequence
#495Key-value storeDecideLarge engine with its own file format; std.sqlite already covers transactions and ordered keys
#496SketchesPlentySmall algorithms over arrays and hashes
#497Xor filtersPlentyShort construction over a fixed key set
#498Cuckoo filtersPlentyA small hash table
#499std.templatePlentyAlready chosen; tera renders from serde values

Issue #471 designs derived serialization and makes no implementation choice. Issue #479 is closed.

Shared contracts

Establish binary buffers, partial-progress I/O, contextual errors and monotonic deadlines before consumers invent incompatible alternatives. Preserve typed Result errors, explicit fallible allocation and existing cooperative cancellation. Specify EOF, short progress, interruption, close/flush errors and cleanup after partial I/O, cancellation or allocation failure.

Structural protocols are statically dispatched. A proposed API must not assume associated types, existential storage, reflection or automatic codec derivation. Use implementable generics, explicit error/value enums and typed codecs. Consuming/borrowing, copied/streamed and in-place/allocating operations need distinct documented contracts. Binary data is not UTF-8 text; filesystem paths are not URLs; simulation randomness is not cryptographic entropy.

Every adopted module publishes its scope, errors, allocation/copy costs, ownership/thread safety, supported platforms and complexity where relevant. Add small reference pages, runnable tutorial examples and SUMMARY entries with the implementation. Use local fixtures, fixed seeds, fake streams/clocks, failure injection, external format fixtures and retained parser fuzz corpora. Test Plenty libraries through plenty test when issue #45 supplies its runner, alongside native primitive/lifecycle tests.

Capability checks and further breadth

The initial CLI/data check reads arguments/environment, loads TOML/JSON, walks files, processes CSV and reports contextual errors/structured logs. Existing math, text primitives, lossless paths, walking, sorting and deque support count toward it. It does not wait for a network execution model. The service check fetches verified HTTPS with cancellation/bounded streaming, persists records in SQLite and serves a routed JSON API meeting the HTTP acceptance gates.

Accurate summation/norms, float decomposition/adjacent values and special functions need numerical contracts; basic math has already shipped. Optional scope still includes timezone/calendar data, statistics, decimal/big-integer/ complex arithmetic, MIME types, HTML escaping/context-aware templates, WebSockets, diff tools, terminals and signals. Evaluate each against a concrete use case before adding an implementation issue/backlog entry. HTTP/2 is a follow-on protocol candidate; HTTP/3 needs a separate decision.

GUI toolkits, mail/FTP stacks, interpreter/debugger internals, arbitrary runtime loading and pickle-style serialization are outside the initial catalogue. YAML, an ORM and a complete web framework also require their own case. Closing the umbrella does not broaden these commitments or claim delivery.