Standard Library

IRIS ships with a standard library of .iris modules. All are implemented in IRIS. Source lives in src/iris-programs/stdlib/.

import "stdlib/option.iris" as Opt
import "stdlib/math.iris" as Math

Data Types#

ModuleDescription
option.irisSome(x) / None with map, and_then, unwrap_or
result.irisOk(x) / Err(e) with map, and_then, unwrap_or
either.irisLeft(a) / Right(b) for disjoint unions
ordering.irisLT / EQ / GT for comparisons

Collections#

ModuleDescription
list_ops.irisreverse, sort, zip, take, drop, flatten
map_ops.irisAssociation-list maps: map_get, map_insert, map_keys
set_ops.irisSets via sorted lists: set_add, set_member, set_union
lazy.irisLazy lists: lazy_unfold, lazy_take, lazy_map, lazy_filter

Strings & Math#

ModuleDescription
math.irisabs, max, min, pow, gcd, clamp, sign, is_prime
string_ops.irisstr_split, str_join, str_replace, str_trim, str_contains
string_utils.irisstr_starts_with, str_ends_with, str_pad_left, str_repeat
constants.irispi, e, phi, tau, numeric conversion helpers

I/O & Network#

ModuleDescription
file_ops.irisread_file, write_file, file_exists, list_dir
http_client.irisHTTP GET/POST with headers, body parsing
http_server.irisHTTP server: route matching, request/response handling
json.irisJSON parser and serializer
json_full.irisExtended JSON with nested objects and arrays
path_ops.irisPath manipulation: join, dirname, basename, extension
time_ops.irisnow_ms, elapsed_ms, timing utilities

Utilities#

ModuleDescription
async_ops.irisAsync/await primitives, spawn, await_result
tco.irisTail-call optimization helpers for deep recursion
quickcheck.irisProperty-based testing: generators, shrinking, check_property
debug.irisdebug_print, assert, trace
reader.irisReader monad for configuration threading
writer.irisWriter monad for logging and accumulation

Compiler Infrastructure#

The self-hosted compiler pipeline lives in src/iris-programs/:

DirectoryPurpose
syntax/Tokenizer, parser, import resolver
compiler/AST compiler, native VM, ELF generator
interpreter/Self-interpreter and evaluator
checker/Proof kernel client, verification
evolution/NSGA-II engine, fitness functions
mutation/Graph mutation operators
population/Population management and selection
repr/SemanticGraph, BLAKE3 hashing, serialization
tools/REPL, package manager, build tools