Skip to content

Standard library

Thor uses the standard library resolved by the selected zapc; it does not copy the library into each project. For editor configuration or a custom tool, the active compiler reports that directory with:

Terminal window
zapc --print-stdlib-path

Common names such as println, StringView, List, and toString are available through the automatic prelude. Import a module when you need the rest of its API.

ModulePurpose
std/ioTerminal input and output
std/stringString views, trimming, splitting, and building
std/stringsSplit and join lists of strings
std/collectionDynamic lists and string-keyed maps
std/sliceChecked helpers for slices
std/convertPrimitive conversions and integer parsing
std/fsFailable file and directory operations
std/pathParent, basename, and path joining
std/processArguments, working directory, execution, and exit
std/mathBasic integer and floating-point helpers
std/randomSeeded PCG32 pseudo-random generation
std/jsonEarly JSON object parser
std/networkTCP-style streams, listeners, and raw socket wrappers
std/errorA general structured error value
std/memUnsafe C allocation functions