Module Reference
Reference pages list the functions and types in each runtime module. Start with the standard library overview to choose a type or find a function for a particular task.
The x2c C API collects the stable x2c_* entry
points used by generated code, native callers, and compiler setup.
Modules
| Module | Description |
|---|---|
lib/args.x | parse program arguments against a declarative spec. |
lib/array.x | dynamic contiguous arrays of Var elements. |
lib/atom.x | canonical exact names. |
lib/autodiff.x | reverse-mode differentiation recorded on a runtime tape. |
lib/block.x | checked dynamic storage for fixed-width elements. |
lib/buffer.x | growable text buffer with indentation support. |
lib/common.x | the shared Var union and operations used by every module. |
lib/context.x | bounded runtime state and value export. |
lib/diff.x | line differences between two texts. |
lib/digest.x | SHA-256 digests of Strings and streams. |
lib/dispatch.x | typed descriptors for runtime Var behavior. |
lib/error.x | handler stack and accumulated errors. |
lib/exception.x | transfer frames for x2c Error unwinding and cleanup. |
lib/file.x | File I/O operations and stream handling. |
lib/func.x | generic native function binding. |
lib/iter.x | single-pass pull iterators. |
lib/json.x | JSON text to and from ordinary x2c values. |
lib/lib.x | disjoint sets with union-find. |
lib/lisp.x | the Lisp runtime: reader, session, and evaluator. |
lib/list-selectors.x | optional compound List selectors. |
lib/list.x | linked list with Var elements. |
lib/logger.x | owned structured event delivery. |
lib/map.x | hash table mapping Var keys to Var values. |
lib/match-recursive.x | optional reference matcher. |
lib/match.x | pattern matching and transformation utilities for lists. |
lib/meta.x | the compiler surface a meta function calls. |
lib/mutex.x | shared mutable-state coordination. |
lib/path.x | filesystem locations and the operations on them. |
lib/pool.x | nested interning pools with region-backed object storage. |
lib/process.x | run commands and pipelines without a shell. |
lib/regex.x | regular expressions over the bytes of a String. |
lib/scope.x | memory allocation scope management. |
lib/scripting.x | the modules every script unit includes. |
lib/split.x | String field splitting and repeatable typed cursors. |
lib/string-classify.x | byte classification for canonical strings. |
lib/string-number.x | numeric parsing from canonical byte strings. |
lib/string.x | canonical byte strings and core text operations. |
lib/symbol.x | immediate encoded names. |
lib/symbolset.x | immutable ordered sets of compact Symbols. |
lib/thread.x | Context-backed native worker threads. |
lib/typed-array.x | packed typed Arrays generated from shared methods. |
lib/typed-list.x | typed cons chains generated from typed methods. |
lib/typed-map.x | typed Maps generated from shared storage. |
lib/var.x | variant type for dynamic typing. |
lib/varconvert.x | Var numeric conversion policy. |
lib/varops.x | boxed Var operators, updates, and truthiness. |
Optional x2c modules
These modules ship with x2c but are not loaded by the standard prelude. Include one explicitly to use its declarations.
lib/args.x- Argument parsing against a declarative spec; explicitly includeargs.xto use it.lib/autodiff.x- Runtime reverse-mode differentiation on a tape; explicitly includeautodiff.xto use it.lib/diff.x- Line differences between two texts; explicitly includediff.xto use them.lib/digest.x- SHA-256 digests ofStrings and streams; explicitly includedigest.xto use them.lib/json.x- JSON text to and from ordinaryMap,Array,String, and number values; explicitly includejson.xto use it.lib/list-selectors.x- Compound selectors beyond caar, cadr, cddr, and caddr; explicitly includelist-selectors.xto use them.lib/match-recursive.x- Readable recursiveMatchreference; explicitly includematch-recursive.xfor differential testing.lib/meta.x- Syntax builders and compiler operations formetafunctions. Pure builders also run at runtime; operations that query the compiler remain compile-time only. Explicitly includemeta.xwhere the functions are parsed.lib/path.x- Filesystem operations on pathStrings; explicitly includepath.xto use them.lib/process.x- Commands, pipelines, and background jobs without a shell; explicitly includeprocess.xto use them.lib/regex.x- Regular expressions over the bytes of aString; explicitly includeregex.xto use them.lib/scripting.x- Theargs.x,diff.x,digest.x,path.x,process.x, andregex.xmodules that every script unit includes; includescripting.xto use all six.lib/typed-array.x- Packed typed storage with a raw native bracket; explicitly includetyped-array.xto use it.lib/typed-list.x- Typed views over canonicalListcells; explicitly includetyped-list.xto use them.lib/typed-map.x- Typed maps over native numeric or canonicalStringfields; explicitly includetyped-map.xto use them.
Runtime-internal
These modules implement the runtime and are not public APIs.
lib/cmath.x- C99<math.h>prototypes, declared so aVarargument unboxes at a math call; the unit still includes<math.h>.lib/error_init.x- Type-owned initialization shim that preservesError’s pre-initialization boundary.lib/lisp-machine.x- Private compile-time Lisp wordcode decoder.lib/machine.x- SharedMatchand Lisp wordcode, builder, and execution-state definitions.lib/match-machine.x- PrivateMatchwordcode decoder.lib/protocols.x- The built-inCleanup,Block,Iter, andVarprotocol declarations used to generate runtime dispatch adapters.lib/scan.x- Allocation-free character scanners used by the tokenizer.lib/static-init.x- Compiler-owned first-use static storage and initialization guards.lib/thread-state.x- Native pthread-key storage for per-thread runtime state.lib/tokenizer.x- Token stream used by the compiler and the Lisp reader.