Skip to content

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

ModuleDescription
ConsoleTerminal output with Console.WriteLine and Console.Write
StringString manipulation — SubString, IndexOf, Replace, Trim
MathMathematical functions — Math.Sqrt, Math.Sin, Math.Pow
CollectionsHashMap, HashSet, Stack, Queue, and more
FileFile I/O — File.ReadAllText, File.Open, Directory, Path
DateTimeDate/time, TimeSpan, and Stopwatch
ThreadThread creation, Mutex synchronization
RegexRegular expression matching and replacement
ReflectionRuntime type inspection via typeof()
SIMDVector 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)
}