Standard Library
The Quadrate standard library provides modules for common programming tasks.
Using Modules
Import a module with use:
use str
use math
fn main() {
"hello" str::upper print nl // HELLO
16.0 math::sqrt print nl // 4
}
Fallible Functions
Functions marked with ! can fail and require error handling:
use str
fn main() {
"hello" 0 3 str::substring! print nl // "hel"
}
Available Modules
| Module | Description |
|---|---|
| bits | Bit manipulation utilities |
| bytes | Byte buffer operations |
| flag | Command-line flag parsing |
| fmt | Formatting utilities |
| io | File I/O operations |
| limits | Numeric type limits |
| math | Mathematical functions, vectors, matrices |
| mem | Memory management |
| os | Operating system interface |
| path | File path manipulation |
| rand | Random number generation |
| sb | String builder |
| signal | Signal handling |
| str | String operations |
| strconv | String conversion utilities |
| term | Terminal operations |
| testing | Testing framework |
| thread | Threading primitives |
| time | Time and date operations |
| unicode | Unicode utilities |