x-lang Reference
Generated from source by make doc-x.
Bootstrap
Core
- x/core/alist — Association-list bootstrap: get/has?/del/put/keys and let-opts.
- x/core/arithmetic — Variadic +, -, *, /, % folded over the binary C primitives.
- x/core/boolean — Short-circuit logical AND and OR operatives.
- x/core/control — Conditional: evaluate test, then branch.
- x/core/fn — Higher-order function combinators, homed on the Fn class.
- x/core/list — Boot-layer list plumbing; public list processing lives on the List class.
- x/core/logic — Boolean logic, structural equality, and derived comparisons.
- x/core/math — Integer arithmetic utilities and number predicates, homed on the Num class.
- x/core/op-guard — Non-numeric types (string, list, pair, vector) refuse the arithmetic operators with err:type instead of falling through to pointer arithmetic; symbols cannot (their type slot is the interning tree, not a registered type) and remain the documented residual; booleans refuse via type/bool.x.
- x/core/predicates — Test if a value is nil (the empty list).
- x/core/quasi — Quasiquote: template with unquote and splicing.
- x/core/syntax — Derived syntax forms: cond, case, when, unless, letrec.
Types
- x/type/array — Array: the growable container – amortized O(1) push!, O(1) indexed access, over a vector backing store.
- x/type/assoc — Association list operations, homed on the Assoc class.
- x/type/base — Base: execution-context / sandbox objects, via the Base class.
- x/type/block — Block-form methods: write a callback’s names and body at the call site.
- x/type/bool — BOOL: the boolean singletons as a real x-defined type – (Type of #t) answers, and arithmetic on booleans refuses through the op registry instead of falling through to machine math.
- x/type/buf — Tokenizer buffers (Buf) and the token stream (Tok): the low-level reader surface for custom types.
- x/type/char-io — UTF-8-aware write/display handlers for CHARACTER values, so a code point renders as its glyph.
- x/type/char — Character operations as the Char class.
- x/type/class — Object-oriented class system: classes-as-objects, message passing, single inheritance.
- x/type/convert — Generic type conversion: the Convert class over the type system’s from/to alists.
- x/type/counter — A counting map, homed on the Counter class.
- x/type/deque — A double-ended queue, homed on the Deque class.
- x/type/dict — Dict: a mutable content-hashed table – the O(1) associative container.
- x/type/err-io — Write/display handlers for ERR, the engine’s raised-error value – the default wording of an engine error, and the stack a lang pushes its own over.
- x/type/err — Structured errors: the Err class, tag taxonomy, errno translation.
- x/type/gen — Lazy generators: produce-on-demand sequences with the usual functional toolbox.
- x/type/generic — Generic functions over the class and type systems.
- x/type/hash — FNV-1a string hashing, homed on the Hash class.
- x/type/io — Input/output on the Io class: write/display (also bare), read/read-char, the to-string captures, and the REPL hooks.
- x/type/iter — Iterator protocol as the Iter class: build/new/make, drive next/empty?, consume ->list/for-each/fold.
- x/type/list — List: the list/sequence API, homed on the List class.
- x/type/obj — Raw object layer: construction, slot and metadata access, FFI handles, on the Obj class.
- x/type/path — Pure-string pathname manipulation on the Path class.
- x/type/pq — A binary-heap priority queue, homed on the Pq class.
- x/type/promise — Lazy evaluation: the delay form plus the Promise class.
- x/type/ptr — Raw pointers (Ptr) and the foreign-function interface (Ffi): the FFI surface for C interop.
- x/type/record — Lightweight named-field records over the class system.
- x/type/regex — Regular expressions with literal syntax; operations homed on the Regex class.
- x/type/set — Set: mutable membership with O(1) expected add/has?/del, plus the set algebra, on a Dict.
- x/type/str-utf8 — The low-level UTF-8 code-point layer for the STRING type: the list<->str transforms and the bare (s i) code-point indexing handler.
- x/type/str — String library: the Str8 / StrUtf8 protocol classes and the byte accessors.
- x/type/trait — Trait definition and predicate; the mixing happens in def-class.
- x/type/type — Type-system reflection: construction, lookup, struct navigation, and handler-stack wiring on the Type class.
- x/type/vector — Fixed-size indexed vectors; operations homed on the Vector class.
System
- x/sys/date — Civil dates over unix time on the Date class: from-unix / to-unix / now / ->iso / leap-year?.
- x/sys/file — File I/O via POSIX syscalls, homed on the File class.
- x/sys/gc — Garbage collection control: collect/count/limit! and the mark/free/root hooks, on the Heap class.
- x/sys/opts — Command-line parsing against a declaration of flags and valued options, on the Opts class.
- x/sys/pact — Deferred cross-module registration: run a pairwise setup once every party has loaded, in any load order.
- x/sys/posix — POSIX system call wrappers, homed on the Sys class.
- x/sys/proc — Proc: run argv as a child process – wait for status, or capture stdout.
- x/sys/socket — Blocking IPv4 TCP on the Socket class, over libc FFI.
- x/sys/stream — Output redirection as first-class Streams: to-fd/to-file/stdout/stderr, (s with thunk)/write/display/close, plus the with-fd / with-file helpers.
Numeric Tower
- x/num/bigint — Arbitrary-precision integers, homed on the Bigint class.
- x/num/complex — Complex number arithmetic with rectangular and polar forms.
- x/num/decimal — Arbitrary-precision decimal floating-point, homed on the Decimal class.
- x/num/float — IEEE 754 floating-point arithmetic, homed on the Float class.
- x/num/random — Pseudo- and hardware random number generation.
- x/num/rational — Exact rational number arithmetic, homed on the Rational class.
- x/num/tower — The numeric tower’s mixed-type arithmetic, homed on seven generics.
Documentation
- x/doc/doc-gen — Documentation generator from x-lang source tokens; output format rides an emitter (x/doc/emit).
- x/doc/doc-prims — Retroactive documentation for C primitives, boot forms, and type system functions.
- x/doc/doc — Inline documentation system.
- x/doc/emit-man — roff (man page) emitter for the documentation generator.
- x/doc/emit — The documentation output protocol (DocEmit) and its Markdown implementation (DocMd).
- x/tool/asm-cache — The compile-asm door: a persistent cache of emitted native code, over the
- x/tool/asm-compile — JIT compiler: x-lang to native code via assembler.
- x/asm — Data-driven assembler with JIT execution via mmap.
- x/tool/compile — Native code compiler: JIT assembler (default) with C compiler fallback.
- x/tool/contract — Shared scaffold for the in-language gate ratchets, on the Contract class: the sorted recursive walk, sorted-list set ops (sort/uniq/only), the tool’s own argv behind the engine prefix, and the allocation guard.
- x/tool/cov — Library coverage analysis for x-bin-profile instrumented code.
- x/tool/fmt — Comment-preserving s-expression formatter on the Fmt class.
- x/tool/highlight — Lexical syntax highlighter for x-lang, emitting Rouge token classes.
- x/tool/lint — AST linter via the type-system write stacks: name-based def/use analysis + first/rest + tail-def-leak + pedantic (arity / non-callable / duplicate-def) checks.
- x/tool/pin — > Member: data carried by a Pin instance.
- x/tool/profile — Performance profiling and smart garbage collection.
- x/tool/safe-access — Development aid: (first ()) and (rest ()) raise instead of crashing.
- x/platform/dirent — The shared getdents batch decoder.
- x/platform/socket — Socket constant lookup tables for Linux socketcall, protocol families, and socket types.
- x/platform/syscall — Syscall number tables for x86_64, i386, and Darwin/BSD. Maps symbolic names to syscall numbers.
Top-level
- x/rn — x/rn: Experimental hacking dialect built on x-lang.
- x/boot/engine — Boot: the engine seam – the one place the library names its engine, carrying both contract includes and the engine root.
- x/xe — x/xe: Stable full-stack dialect built on x-lang.