Standard Library Overview
What’s Included
The Cera standard library provides built-in modules covering common programming needs. All modules are available without any explicit import.
Module Summary
| Module | Description |
|---|---|
Console | Terminal output with Console.WriteLine and Console.Write |
String | String manipulation — SubString, IndexOf, Replace, Trim |
Math | Mathematical functions — Math.Sqrt, Math.Sin, Math.Pow |
Collections | HashMap, HashSet, Stack, Queue, and more |
File | File I/O — File.ReadAllText, File.Open, Directory, Path |
DateTime | Date/time, TimeSpan, and Stopwatch |
Thread | Thread creation, Mutex synchronization |
Regex | Regular expression matching and replacement |
Reflection | Runtime type inspection via typeof() |
SIMD | Vector math utilities — SIMD.Sqrt, SIMD.FMA, SIMD.Min, SIMD.Max |
Using Standard Library Types
All standard types are available in the global scope:
Console.WriteLine("Hello, world!")float n = Math.Sqrt(144.0)HashMap<string, int> map = HashMap<string, int>()Error Handling
Standard library functions signal errors either by returning sentinel values or by throwing exceptions. Consult each module’s documentation for specifics.
if File.Exists("config.txt"){ string text = File.ReadAllText("config.txt") Console.WriteLine(text)}