Skip to content

Standard Library

Standard Library

The current repository ships a small runtime-backed standard library. The modules that are fully present in stdlib/ today are std.io, std.math, std.string, and std.time.

Shipped modules

ModuleImport styleStatus
std.ioimport std.io as ioshipped
std.mathimport std.math as mathshipped
std.stringimport std.string as stringshipped
std.timeimport std.time as timeshipped

Planned but not yet shipped as stdlib modules

These pages exist in the docs because they are part of the intended surface area, but the repository does not currently contain matching stdlib/*.tg modules:

Module pageRepository status
vecno stdlib/vec.tg yet
sortno stdlib/sort.tg yet
collectionsno stdlib/collections/ tree yet
iterno stdlib/iter.tg yet
fmtno stdlib/fmt.tg yet
convertno stdlib/convert.tg yet

Those pages document the current gap and point to the closest available APIs in the live toolchain.

Typical imports

import std.io as io
import std.math as math
import std.string as string

Practical guidance

  • Use std.io for console I/O and buffered input.
  • Use std.math for arithmetic helpers and builtin constants.
  • Use std.string for conversion and text processing.
  • Use std.time when you need timestamps in current builds.