Standard Library
The Autolang Standard Library provides a deterministic, resource-bounded set of capabilities. Core collections and primitives are available globally without import. Specialized modules for serialization, network I/O, cryptography, and dates are loaded on demand via @import.
Core Auto-Imported Types & Collections
The core types below are always in scope across all files. No import directive is required.
Global Functions
| Function Signature | Description |
|---|---|
| println(val: Any?) | Outputs value followed by a newline. |
| print(val: Any?) | Outputs value without a newline. |
| assert(condition: Bool, message: String = "") | Validates invariants, throwing an Exception on failure. |
| minOf(a, b) / maxOf(a, b) / clamp(v, min, max) | Numeric bounds and clamping functions. |
| require(condition) / check(condition) | Argument and state verification with clean error propagation. |
| measureTimeMillis(block: () -> Void): Int | Measures the elapsed execution time of a closure in milliseconds. |
| sleep(milliseconds: Int) | Pauses execution for the specified duration. |
Standard Modules (Import Required)
Import specialized capabilities using @import("std/...") at the top of the file:
JSON Processing
Parsing, serialization, schema validation, and typed DTO decoding.
std/httpHTTP Client
Synchronous requests and concurrent batch queries under strict domain filtering.
std/fileFile System & I/O
Streamlined reading, writing, and directory inspection within sandboxed paths.
std/dateDate & Time
ISO parsing, calendar arithmetic, formatting, and leap year validation.
std/mathMath Functions
Powers, logarithms, roots, trigonometry, and pseudo-random generators.
std/regexRegular Expressions
Pattern matching, group extraction, text replacement, and validation.
std/bytesRaw Byte Buffers
Binary I/O, endianness encoding, Hex, and Base64 transformations.