Standard library

Langoost ships with a large standard library. Import any module by name with import modulename, then call functions with dot syntax. Each module below has its own reference page.

Built-in functions

Always in scope, no import required:

print, println, len, toString, toInt, toFloat, range, typeof, append, read, exit.

Text & data

ModulePurpose
stringsSearch, slice, split, join, case, padding, formatting, builder
regexRegular expressions: match, find, replace, capture groups
typesRuntime type checks and conversions
jsonParse, query, edit, and stream JSON
yamlParse and serialize YAML
xmlValidate, query, and convert XML
urlParse and build URLs and query strings
encodebase64, hex, CSV, binary, JSON/XML (submodules)
encodingflat base64 / base32 / hex helpers
serializemsgpack and protobuf
protoProtocol Buffers — wire format and .proto schemas
compressgzip, zlib, lz4, brotli

Math & collections

ModulePurpose
mathArithmetic, trig, logs, random, bitwise, interpolation
collectionsStack, queue, set, map, heap, trie, ring, list, tuple

Time

ModulePurpose
timeClock, dates, timers, durations, formatting
dateConvenience date API over Unix timestamps
timersetTimeout, setInterval, clear

System & I/O

ModulePurpose
ioFiles, streams, and path helpers
osEnvironment, process, signals, permissions
execRun shell commands and programs
signalPOSIX signal handlers
terminalRaw mode, key input, ANSI colors and cursor
runtimeIntrospection and a process-global shared store
memoryByte buffers, interning pools, GC stats
loggingLeveled logging with a debug toggle

Media

ModulePurpose
imageImage processing — resize, crop, rotate, filters (PNG/JPEG/GIF/TIFF/BMP)
ffmpegTranscode and probe media via system ffmpeg/ffprobe

Networking

ModulePurpose
netTCP, UDP, TLS, DNS, and an HTTP client
httpHTTP client (the built-in server is in HTTP server)
http2HTTP/2 server — TLS h2 and cleartext h2c
formParse URL-encoded and multipart form bodies
stunSTUN client and BIND server (NAT discovery)
turnTURN relay server
webrtcWebRTC peer connections and data channels
tunTUN virtual network interface (raw IP packets)

Hardware

ModulePurpose
gpioGPIO pins, hardware PWM, I²C, and SPI (Raspberry Pi and similar)

Crypto & data stores

ModulePurpose
cryptoHashing, HMAC, AES, RSA, Ed25519, X25519, HKDF, random, certs, TLS
redisRedis client — key/value, lists, hashes, pub/sub
sqlSQLite, Postgres, and MySQL
mongoMongoDB client — insert, find, update, delete, count
raftRaft consensus node (replicated log)

Testing

The assert module (eq, ne, ok, throws) pairs with the built-in test runner — see the testing guide.

Concurrency

ModulePurpose
threadGoroutines, pools, futures, channels, mutexes, RW locks, semaphores, atomics

The concurrency guide is a tutorial-style walkthrough of the same module. Shared state across tasks lives in runtime.core — see the runtime module.

Standard library · View as Markdown · llms-full.txt