The standard library is documented in one place: the
Standard Library Reference. It opens with an index of
every module, generated from the source and checked by make check-docs, and
its examples are compiled and run by the same check. This page is a way into
it by task.
Start with Using the Standard Library for the three conventions every module follows: errors come back as values, the C layer is exported alongside the wrappers, and whatever you create, you release. Then see Platform support for what changes on Windows, WASI and the browser.
| To... | Go to |
|---|---|
| Hold values in a list, map, set or queue | Collections |
| Build, split, search or format text | Strings, Regular expressions |
| Read and write files, walk directories, join paths | File System |
| Print, read standard input, set environment variables | I/O |
| Parse or produce JSON | JSON |
| Use YAML, XML, MessagePack, CBOR or CSV | Other structured-data formats |
| Hash, sign, encrypt, or encode Base64 | Cryptography, Encodings |
| Compress data | Compression |
| Make HTTP requests or serve HTTP | HTTP |
| Open TCP connections | TCP |
| Run another program | Running programs |
| Read command-line arguments | Command-line arguments |
| Tell the time, or measure elapsed time | Dates and times |
| Log | Logging |
| Do arithmetic beyond the operators | Math |
| Generate unique ids | Identifiers |
| Localise messages and plurals | Internationalisation |
| Run work concurrently | Concurrency |
| Control allocation, or read raw memory | Memory |
| Confine what a program can reach | Sandboxing |
| Run as a library inside another application | Embedding in a host |
A module this table does not name is in the reference's index, which links each one to its guide and source.