Open Manual

<!-- nytrix-doc: {"audience":"user","featured":true,"group":"learn","order":30,"summary":"A guided map of the standard library, its major namespaces, and how to choose the right module."} -->

Library

Start with the facade that owns the problem, then ask generated docs for exact

signatures and exported names.

The façade modules carry their own source-adjacent guides: open std.core for

values and collections, std.os for host services and portability boundaries,

and std.math for numeric, parsing, algorithmic, and crypto namespaces. The

generated reference renders those module-header guides directly, so the source

file and the website stay in sync.

ny doc search socket
ny doc search --symbols recvuntil
ny doc get std.os.net.remote

First Module

NeedFirst lookup
Assertions, strings, containers, terminal outputstd.core
Files, paths, time, processes, threadsstd.os
HTTP, sockets, process tubes, transcriptsstd.os.net
Windows, drawing, input, gamepads, textures, scenesstd.os.ui.render, std.os.ui.window
JSON, YAML, TOML, CSV, XML, SQL, zlibstd.math.parse.data
Images, fonts, glTF, meshesstd.math.parse.img, std.math.parse.font.truetype, std.math.parse.3d.gltf
Scalars, big ints, matrices, number theory, SIMDstd.math
Encodings, hashes, ciphers, public-key helpers, analysisstd.math.crypto

Clipboard

Use std.os.set_clipboard_text(text) and std.os.get_clipboard_text() for

plain-text copy and paste. Desktop targets use the platform clipboard tools.

The browser target uses the Clipboard API, which requires a secure context,

permission, and a user gesture; unavailable access returns false or an empty

string instead of pretending that the operation succeeded.

Use aliases when call sites would otherwise hide ownership:

use std.math.parse.data.json as json
def obj = json.json_decode("{\"ok\":true}")

Domains

DomainModules
Corestd.core, std.core.str, std.core.iter, std.core.collections, std.core.dict, std.core.set, std.core.tuple, std.core.counter, std.core.reflect, std.core.regex, std.core.error, std.core.term, std.core.test, std.core.tbuf, std.core.mem, std.core.io, std.core.glob, std.core.progress, std.core.inspect
Syntax helpersstd.core.syntax, std.core.syntax.builtin, std.core.syntax.type
OSstd.os, std.os.args, std.os.path, std.os.fs, std.os.io, std.os.process, std.os.subprocess, std.os.time, std.os.clock, std.os.thread, std.os.atomic, std.os.parallel, std.os.async, std.os.ffi, std.os.disasm, std.os.gpu, std.os.accel, std.os.sound, std.os.clipboard, std.os.info, std.os.platform, std.os.sys
Networkingstd.os.net, std.os.net.requests, std.os.net.server, std.os.net.remote, std.os.net.socket, std.os.net.http, std.os.net.curl
UIstd.os.ui, std.os.ui.window, std.os.ui.window.consts, std.os.ui.window.input, std.os.ui.render (backend facade), std.os.ui.render.gl, std.os.ui.render.vk, std.os.ui.render.viewer, std.os.ui.render.viewer.widgets, std.os.ui.render.viewer.input, std.os.ui.render.viewer.window, std.os.ui.render.viewer.clipboard, std.os.ui.render.viewer.app, std.os.ui.render.camera, std.os.ui.assets
Datastd.math.parse.data.json, yaml, toml, csv, xml, sql, zlib
Syntax parsersstd.math.parse.syntax.nytrix, c, javascript, typescript, python, bash, lua, html, markdown, json, xml, yaml, cmake, assembly
Assetsstd.math.parse.img, std.math.parse.img.png, jpeg, gif, bmp, svg, tga, webp, exr, std.math.parse.font.truetype, std.math.parse.3d.gltf, meshopt, obj
Mathstd.math, integer, float, scalar, big, bigrat, bin, complex, ct, gf, hensel, logic, matrix, noise, nt, ntt, poly, quat, random, ring, simmd, smt, stat, vector
Cryptostd.math.crypto.encoding, hash, symmetric, block.mode, block.stream, cipher, rsa, ecc, lattice, factorization, prng, analysis

For constrained factor searches, use the focused

std.math.crypto.factorization.xor module. It reports candidate pairs and

the identity \(p+q=x+2c\), where \(x=p\mathbin{\oplus}q\) and

\(c=p\mathbin{\&}q\), instead of presenting itself as a general-purpose

factorization engine.

std.math.logic provides self-hosted propositional reasoning. Propositions are

ordinary explicit dictionaries created with prop_true, prop_false,

prop_atom, prop_not, prop_and, prop_or, prop_implies, and prop_iff.

Use prop_is to validate external data, prop_eval with an atom environment,

and prop_simplify for deterministic constant simplification.

prop_tautology_report exhaustively decides bounded propositions and returns

decided, valid, the variable list, a counterexample assignment, and the

checked/required assignment counts. Its

default limit is 16 variables and the accepted maximum is 20; exceeding the

chosen limit returns decided=false instead of silently guessing or running

without a bound. prop_tautology is the compact boolean facade.

The short vocabulary keeps ordinary code readable:

use std.math.logic as logic

def p = logic.atom("p")
def identity = logic.implies(logic.conj(p, logic.truth()), p)
def result = logic.decide(identity)
assert(result.get("decided") && result.get("valid"))

std.math.logic.prolog is a self-hosted logic-programming engine with explicit

variables, compound terms, facts, rules, occurs-checking unification, recursive

backtracking, and bounded queries. Query results contain friendly answers

for variables from the original goal, plus raw solutions, step count, peak

depth, logical workspace usage, reason, and decided. Step, solution, depth,

variable, and workspace limits are explicit; hitting one returns

decided=false.

use std.math.logic.prolog as prolog

def X = prolog.variable("X")
def kb = [prolog.fact(prolog.term("likes", ["ada", "math"]))]
def result = prolog.query(kb, prolog.term("likes", ["ada", X]))
print(result.get("answers")) ; [{X: math}]

std.math.logic.rewrite reuses those terms for deterministic normalization:

use std.math.logic.prolog as prolog
use std.math.logic.rewrite as rewrite

def X = prolog.variable("X")
def zero = prolog.term("zero")
def rules = [rewrite.rule(prolog.term("add", [X, zero]), X)]
def result = rewrite.normalize(prolog.term("add", [42, zero]), rules)
assert(result.get("decided") && result.get("value") == 42)

Normalization reports its reason, passes, steps, and visited nodes. Pass, step,

depth, and node limits are explicit, and exhaustion returns decided=false.

Short names in this table continue the namespace shown earlier in the same row.

Flat APIs

Many modules export flat function names. Import aliases namespace those names;

they do not create methods that are not exported.

Time

std.os.time exports time, now, unix, now_ms, sleep, msleep,

ticks, monotonic_ns, Instant, Timer, elapsed helpers, and

format_time.

Use msleep(ms) for millisecond sleeps. Use now_ms() for wall-clock

milliseconds and ticks() or monotonic_ns() for elapsed-time measurements.

Threads

use std.core
use std.os.thread

fn worker(any arg) any { arg }

def handle = thread_spawn(worker, "ok")
assert_eq(thread_join(handle), "ok", "thread")

thread.spawn is not exported.

Parallel

Use future(work, arg) or async(work, arg) for joinable work, then

future_wait(handle). Use detach(work, arg) for fire-and-forget work.

parallel_map and parallel_map_indexed preserve input order.

fork, task, and join are not exported names in this module.

UI Notes

Use UI for a first window, frame loop, drawing, input, textures,

and 3D start. Lower-level Vulkan modules are for renderer implementation and

targeted probes, not normal app setup.

3D References

Generated Reference

Generated docs own signatures and docstrings:

ny doc search --symbols json_decode
ny doc get std.math.parse.data.json

Related guides: