Skip to content

Standard Library Overview

Standard Library Overview

Thagore’s standard library is split across two locations:

DirectoryPurposeImport Style
lib/High-level modules (fs, string, io, env, process, path, http, time, map)import fs
std/Low-level core primitives (core, string, list)import "std/core.tg"

Module Reference

Core & std

Low-level primitives: memory, pointers, string builder, list data structure.

I/O, Env & Process

Console I/O, environment variables, command-line args, and process management.

Path, HTTP & Time

File path manipulation, HTTP client, and time functions.

Quick Reference

ModuleImportKey Functions
fsimport fsread_text, write_text, exists, mkdir, list_dir, open_read, open_write
string (lib)import "lib/string.tg" as strlen, trim, contains, starts_with, ends_with, replace, lower, upper, quote
string (std)import "std/string.tg"substring, char_at, to_string_i32, builder_new, append
ioimport ioinput, input_prompt, stdin_read_all, stdread, input_i32
envimport envcount, get, program_name, get_var, set_var, cwd
processimport processrun, exec, exec_timeout, exec_redirect, download, unzip
pathimport pathjoin, basename, dirname, ext, stem
httpimport httpget, post, request
timeimport timenow_ms, sleep_ms
list (std)import listnew, push, get, set, len, dispose
mapimport mapnew, put, get, is_null_ptr
core (std)import "std/core.tg"malloc, free, print_i32, print_str, abort