Standard library
A map of the insty standard library — core, std, and the platform namespaces.
The standard library lives next to the compiler and is the module search root. :: is the directory
separator, so a module at libs/<dir>/<name>.ins is imported as import <dir>::<name>.
core — freestanding primitives
Target-agnostic, safe in freestanding mode.
core::core— runtime intrinsics the compiler relies on (memcpy/memset, formatters, allocator hooks)core::mem—copy,set,zero,eq(raw byte operations)core::bits— bit/flag helperscore::bytes— length-tagged, non-owning byte slices
std — hosted modules
Higher-level modules that assume a hosted OS.
std::io—print,println,eprintln, … (raw write syscalls, no libc)std::str— read-onlytexthelpers:len,eq,starts_with,find,to_i64, …std::math—abs,min,max,clamp,sign,powstd::vec—Vector<T>, a growable generic array (needs an allocator)std::string—String, an owned, growable UTF-8 builder (needs an allocator)std::map—StringMap<V>, atext-keyed hash map (needs an allocator)std::fs—open,read,write,read_file,write_file(raw syscalls)std::alloc,std::fmt,std::ascii,std::parse,std::coff,std::uefi
Platform namespaces
windows— Win32 bindings forx86_64_windows, imported straight from system DLLs (windows::core,windows::io,windows::files,windows::mem,windows::ui)instantos— raw InstantOS userland syscalls (instantos::sys,instantos::io,instantos::mem)unix,posix— reserved namespaces the portablestdlayer will build on
Example
module main
import std::vec
fun main() -> i32 {
Vector<i32> v = Vector<i32>{}
v.push(1)
v.push(2)
return v.len() // needs --allocator runtime
} Anything that allocates (
Vector,String,StringMap) requires a heap — build with--allocator runtimeor--allocator external.