Standard Library
The AodhML standard library provides core functionality organized into modules.
Prototype Status: The standard library is partially implemented. Listed modules marked "Planned" are not yet available.
Core Modules
| Module | Description | Status |
|---|---|---|
std:io | Console I/O, file operations | Partial |
std:math | Mathematical functions | Partial |
std:random | Pseudo-random number generation | Partial |
std:string | String manipulation | Partial |
std:array | Array/List operations | Partial |
std:map | Map/dictionary operations | Planned |
AI/ML Modules
| Module | Description | Status |
|---|---|---|
std:tensor | Tensor creation and operations | Partial |
std:nn | Neural network layers | Planned |
std:optim | Optimization algorithms | Planned |
std:loss | Loss functions | Planned |
std:dataset | Dataset loading and batching | Planned |
IO Functions
fn println(...args) // Print to stdout with newline
fn print(...args) // Print to stdout without newline
fn read_line() -> String // Read a line from stdin
fn read_file(path: String) -> Result<String, Error>
fn write_file(path: String, content: String) -> Result<void, Error>
Math Functions
fn abs(x: f64) -> f64
fn sqrt(x: f64) -> f64
fn pow(base: f64, exp: f64) -> f64
fn sin(x: f64) -> f64
fn cos(x: f64) -> f64
fn tan(x: f64) -> f64
fn log(x: f64) -> f64
fn exp(x: f64) -> f64
fn floor(x: f64) -> f64
fn ceil(x: f64) -> f64
fn round(x: f64) -> f64
const PI: f64 = 3.141592653589793
const E: f64 = 2.718281828459045
Tensor Functions
fn zeros(shape: [u32]) -> Tensor<f32>
fn ones(shape: [u32]) -> Tensor<f32>
fn randn(shape: [u32]) -> Tensor<f32>
fn matmul(a: Tensor<f32>, b: Tensor<f32>) -> Tensor<f32>
fn transpose(t: Tensor<f32>) -> Tensor<f32>
fn stack(tensors: [Tensor<f32>]) -> Tensor<f32>
fn concat(tensors: [Tensor<f32>], axis: u32) -> Tensor<f32>