Core Tangu prelude: special forms, type constructors, collections, sequence accessors, arithmetic & logical operators, string & byte utilities, stream I/O traits, and test assertions available without imports.
Standard library reference
Built-in modules ship with every Tangu installation under @standard (and /prelude without imports). Select a category or jump directly to any module.
Lazy iterator combinators and reductions (map, filter, fold, reduce, zip, take, skip, chunk, flatten, group-by, partition).
Unordered hash set algebraic operations: union, intersection, difference, symmetric-difference, subset?, and superset?.
Map projection and transformation helpers (pick, extend, union) complementing prelude Map intrinsics.
B-Tree backed ordered map (Sorted-Map) maintaining keys in ascending sorted order.
Explicit hash map container (Unordered-Map) with entry iteration and key/value views.
Fixed-capacity ring buffer (Circular-Buffer) supporting O(1) push/pop and wraparound iteration.
2D, 3D, and 4D Euclidean vector math (Vec2, Vec3, Vec4): dot product, cross product, normalization, and distance.
Higher-order function utilities including partial application, currying, composition, and memoization.
Directed and undirected graph data structures (Graph) with node/edge mutation and traversal helpers.
UTF-8 string utilities for case conversion, trimming, padding, searching, and slugification.
Compiled regular expressions (Regex) with matching, capture extraction, replacement, and splitting.
Human-readable text formatting, title/sentence capitalization, and line wrapping utilities.
Identifier case conversions across camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, and kebab-case.
CommonMark and GitHub Flavored Markdown compiler (to-html) supporting tables, strikethrough, and task lists.
Unicode CLDR internationalization powered by ICU4X: locale-aware numbers, currencies, dates, plurals, collation, and grapheme segmentation.
Dynamic locale scoping and translated message lookup context (t, with-locale) for multilingual applications.
HTML entity escaping, attribute sanitization, and tag stripping for safe user-generated content.
Filesystem operations: reading, writing, copying, moving, recursive tree listing, glob matching, and path canonicalization.
Buffered and standard stream I/O (Buf-Reader, Buf-Writer, Stdin, Stdout, Stderr, read-line, write-line, flush, and ask).
Cross-platform lexical path manipulation: dirname-of, file-name, extension-of, stem-of, join, and normalize.
Host operating system, CPU architecture, hostname, and environment introspection.
Cross-platform XDG / OS standard directories (config-dir, cache-dir, data-dir, home-dir, download-dir).
Subprocess execution (run, spawn), environment variables (env, env-vars), working directory, and exit statuses.
Multi-threaded Tokio async runtime construction and blocking entry points (Async-Runtime, run, block-on).
OS thread spawning, parallel execution, sleeping, and synchronization.
Cooperative coroutines (spawn, await, await-all, sleep) and typed channels (channel, send, recv) backed by Tokio.
Structured diagnostic logging (trace, debug, info, warn, error) with pluggable observer sinks.
Diverging development and assertion helpers (todo!, unimplemented!, unreachable!).
Fast bidirectional JSON serialization (encode, decode, from-json) and derivable To-JSON / From-JSON support.
Compact Concise Binary Object Representation (CBOR, RFC 8949) encoder and decoder for Tangu values.
Percent-encoding and application/x-www-form-urlencoded query-string serialization.
RFC 4180 CSV parser and serializer supporting tuple rows and header-mapped records.
RFC 4648 standard and URL-safe Base64 encoding and decoding for strings and byte slabs.
Declarative Struct field constraint validation (#{:min-len ... :format :email ...}) returning ValidationErrors.
Business-day calendar helpers for workdays, weekends, and nth-weekday offset calculations.
High-level directory tree copying, filename sanitization, and parent directory initialization.
Code generation banner and header formatting helpers.
High-precision clocks (Steady-Clock), civil dates/times (Date, Time, Date-Time), UTC Instants, IANA Zoned-Date-Time, and Duration/Span arithmetic powered by jiff.
Pure Gregorian calendar arithmetic: leap years, days in month, weekday indices, and date comparison.
Standard 5-field cron expression parsing, validation, and schedule matching (Cron, is-matching?, is-matching-now?).
Shared HTTP method, status code, content-type, and request/response inspection predicates.
Async and sync HTTP/HTTPS client with connection pooling, headers, timeouts, and streaming bodies.
Convenience helpers for sending JSON HTTP requests and decoding structured responses (post-json).
High-performance Axum/Tokio HTTP/1.1 & HTTP/2 server supporting static serving, SSE, multipart forms, and WebSockets.
Core full-stack web application primitives: cookies, flash messages, query/form params, responses, and trie router.
Opinionated HTTP server launcher reading HOST and PORT from process environment variables.
Composable HTTP request handlers: chain-handlers, route-map, route-fs, route-graph, handle-html, handle-css, handle-not-found.
Production HTTP middlewares: CSRF, CORS, session, rate limiting, security headers, auth, tracing, and scripts injection.
HTML form binding, type coercion, CSRF token fields (<csrf-field>), and field validation errors (<form-error>).
Cookie-backed and server-side session state management.
Filesystem-driven application route graph (App-Graph) for breadcrumbs, navigation trails, and static site crawling.
XML and plain-text sitemap generators and HTTP handlers constructed from an App-Graph.
Automatic OpenAPI 3.1 specification generator from /web/app route graphs and Struct schemas.
RFC 8291 Web Push payload encryption and VAPID key generation.
WebSocket client supporting text and binary frames, ping/pong, and graceful close.
Declarative command-line argument and subcommand router DSL (action, query, cmd, scope, mount) with automatic help output.
Terminal capability detection, dimensions, raw mode controls, and interactive prompt helpers.
ANSI terminal escape sequences for foreground/background styling, 256-color/RGB output, and text weights.
Color space conversions (hex, RGB, HSL, OKLCH), WCAG contrast ratios, and tonal palette operations.
SHTML (#shtml / #html) node renderer, attribute/class utilities, and template formatter (format-html).
CSS AST compiler and nested stylesheet formatter (format-css, scss->css) powering #css blocks.
Typed Browser DOM and Document/Element interop bindings when compiling Tangu to JavaScript.
Typed Web Platform API bindings (fetch, Storage, History, Workers, URL, WebSocket) for the JavaScript target.
Pooled PostgreSQL client with primary/replica routing, strong consistency reads (query-strong, query-one-strong), and ACID transactions.
Synchronous embedded SQLite connection pool with parameterized queries, row maps, and closure transactions (begin).
Cryptographic hashing (SHA-256), HMAC authentication, AES-GCM/AEAD helpers, CSPRNG tokens, and constant-time equality.
Elliptic Curve Digital Signature Algorithm (ECDSA) P-256 key generation, signing, and signature verification.
RSA public/private key parsing, PKCS#1/PSS signing, and cryptographic signature verification.
Fast non-cryptographic hash algorithms: AHash, FNV-1a, SipHash-1-3, and XXHash64.
JSON Web Token (JWT) HS256 signing and verification (sign-jwt, verify-jwt).
RFC 9562 UUIDv4 (random) and UUIDv7 (time-ordered) generation and validation.
Mathematical constants (pi, e, phi) complementing the prelude math intrinsics.
Numeric interpolation (lerp) and rounding-to-multiple utilities.
Descriptive and rolling statistics: mean, weighted-mean, variance, standard deviation, change metrics, and moving averages.
4x4 floating-point matrix math (Mat4) for 3D transforms, projections, rotations, and inversions.
Portable 128-bit SIMD vector types (F32x4, F64x2, I32x4, I64x2, U8x16) with lane-parallel arithmetic.
Pseudo-random number generation for bounded integers, floats, booleans, and collection sampling.
In-memory raster Image decoding/encoding with format detection, cropping, and high-quality resizing.
AVIF image decoder and encoder for files and byte slabs.
JPEG image decoder and encoder with configurable quality for files and byte slabs.
Lossless PNG image decoder and encoder for files and byte slabs.
WebP image decoder and encoder for files and byte slabs.