Standard Library
The VERA standard library provides portable building blocks under the vera: namespace. Import any module with:
import "vera:io"
Modules
| Module | Description | Primitives |
|---|---|---|
| vera:assert | Testing assertions and result tracking | None (pure VERA) |
| vera:binary | Binary encoding/decoding (big/little-endian) | None (pure VERA) |
| vera:env | Environment variables and .env files | Yes |
| vera:format | String formatting and buffer building | None (pure VERA) |
| vera:io | Console I/O and file operations | Yes |
| vera:math | Mathematical functions (f64) | None (pure VERA) |
| vera:memory | Heap allocation and memory operations | Yes |
| vera:net | TCP/UDP socket operations | Yes |
| vera:net/dns | DNS hostname resolution | None (uses vera:net) |
| vera:string | String and byte sequence operations | None (pure VERA) |
| vera:thread | Threading and synchronization | Yes |
Design Principles
- Minimal primitives: Only ~35 compiler-provided functions (
__vera_sys_*) bridge to the OS. Everything else is pure VERA. - Pure VERA modules:
vera:string,vera:math, andvera:binaryuse zero primitives — they are implemented entirely in VERA using the ISA's arithmetic, memory, and comparison instructions. - Flat (ptr, len) convention: Strings are byte buffers with explicit lengths. No dedicated string type, no null terminators (except when interfacing with C-style APIs).