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
| Module | Import style | Status |
|---|---|---|
std.io | import std.io as io | shipped |
std.math | import std.math as math | shipped |
std.string | import std.string as string | shipped |
std.time | import std.time as time | shipped |
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 page | Repository status |
|---|---|
vec | no stdlib/vec.tg yet |
sort | no stdlib/sort.tg yet |
collections | no stdlib/collections/ tree yet |
iter | no stdlib/iter.tg yet |
fmt | no stdlib/fmt.tg yet |
convert | no 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 ioimport std.math as mathimport std.string as stringPractical guidance
- Use
std.iofor console I/O and buffered input. - Use
std.mathfor arithmetic helpers and builtin constants. - Use
std.stringfor conversion and text processing. - Use
std.timewhen you need timestamps in current builds.