# Tangu Programming Language > A language for humans and machines. Tangu (v0.35.0) is a fast, general-purpose homoiconic s-expression language unifying application code (`.tan`), structured data (`.data.tan`), schemas (`.schema.tan`), and composable DSLs (`#shtml`, `#css`, `#svg`, `#sql`) across a Bytecode VM, Cranelift JIT, Native AOT binaries, Rust crates, and JavaScript modules. ## Quick Links - [Overview](https://tangu.dev/): Language overview, execution targets, and CLI highlights. - [Complete Single-File Reference (`llms-full.txt`)](https://tangu.dev/llms-full.txt): Complete tutorial, guides, CLI, lints, prelude, and all 83 standard library module references. - [Standard Library Markdown Hub](https://tangu.dev/stdlib.md): Direct links to per-module `.md` mirrors. - [Official Installer (`install.sh`)](https://tangu.dev/install.sh): `curl -fsSL https://tangu.dev/install.sh | sh` - [GitHub Organization](https://github.com/tangu-dev): Official source repositories and examples. ## Guides & Reference - [Language tutorial](https://tangu.dev/tutorial) ([Markdown](https://tangu.dev/tutorial.md)): Progressive step-by-step guide from installation and s-expressions to structs, traits, DSLs, coroutines, and tooling. - [Data, UI & SQL DSLs](https://tangu.dev/guides/dsls) ([Markdown](https://tangu.dev/guides/dsls.md)): Unify data manifests, validation schemas, SHTML templates, scoped stylesheets, SVG graphics, and parameterized SQL in one AST. - [Web apps & databases](https://tangu.dev/guides/web-and-db) ([Markdown](https://tangu.dev/guides/web-and-db.md)): Build full-stack HTTP/2 apps with routing, middleware, form validation, PostgreSQL primary/replica queries, and SQLite. - [Agentic & tooling workflow](https://tangu.dev/guides/agentic-workflow) ([Markdown](https://tangu.dev/guides/agentic-workflow.md)): Use machine-readable JSON diagnostics, semantic navigation, safe refactoring, and Markdown mirrors for agentic development. - [Execution, compilation & benchmarks](https://tangu.dev/guides/compilation) ([Markdown](https://tangu.dev/guides/compilation.md)): Explore Tangu's TIR compiler pipeline, execution backends, optimization levels (--opt), runtime profiles, and #bench methodology. - [CLI & editor reference](https://tangu.dev/cli) ([Markdown](https://tangu.dev/cli.md)): Complete reference for all 20 tangu CLI commands, global --json flags, and Language Server Protocol (LSP) capabilities. - [Static lint rules](https://tangu.dev/lints) ([Markdown](https://tangu.dev/lints.md)): Search and filter all 110 built-in static lint rules with category badges, auto-fix flags, and copyable #allow pragmas. - [Standard library reference](https://tangu.dev/stdlib) ([Markdown](https://tangu.dev/stdlib.md)): Interactive directory of the Tangu Prelude and 82 active @standard library modules with full symbol search. ## Standard Library Modules (83 active modules) ### Prelude & core built-ins ([Markdown](https://tangu.dev/stdlib-prelude.md)) - [`/prelude`](https://tangu.dev/stdlib-prelude.md): 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. ### Collections & iteration ([Markdown](https://tangu.dev/stdlib-collections.md)) - [`/iter`](https://tangu.dev/stdlib/iter.md): Lazy iterator combinators and reductions (map, filter, fold, reduce, zip, take, skip, chunk, flatten, group-by, partition). - [`/set`](https://tangu.dev/stdlib/set.md): Unordered hash set algebraic operations: union, intersection, difference, symmetric-difference, subset?, and superset?. - [`/map`](https://tangu.dev/stdlib/map.md): Map projection and transformation helpers (pick, extend, union) complementing prelude Map intrinsics. - [`/sorted-map`](https://tangu.dev/stdlib/sorted-map.md): B-Tree backed ordered map (Sorted-Map) maintaining keys in ascending sorted order. - [`/unordered-map`](https://tangu.dev/stdlib/unordered-map.md): Explicit hash map container (Unordered-Map) with entry iteration and key/value views. - [`/circular-buffer`](https://tangu.dev/stdlib/circular-buffer.md): Fixed-capacity ring buffer (Circular-Buffer) supporting O(1) push/pop and wraparound iteration. - [`/vec`](https://tangu.dev/stdlib/vec.md): 2D, 3D, and 4D Euclidean vector math (Vec2, Vec3, Vec4): dot product, cross product, normalization, and distance. - [`/func`](https://tangu.dev/stdlib/func.md): Higher-order function utilities including partial application, currying, composition, and memoization. - [`/graph`](https://tangu.dev/stdlib/graph.md): Directed and undirected graph data structures (Graph) with node/edge mutation and traversal helpers. ### Text, strings & localization ([Markdown](https://tangu.dev/stdlib-text.md)) - [`/string`](https://tangu.dev/stdlib/string.md): UTF-8 string utilities for case conversion, trimming, padding, searching, and slugification. - [`/regex`](https://tangu.dev/stdlib/regex.md): Compiled regular expressions (Regex) with matching, capture extraction, replacement, and splitting. - [`/text`](https://tangu.dev/stdlib/text.md): Human-readable text formatting, title/sentence capitalization, and line wrapping utilities. - [`/text/case`](https://tangu.dev/stdlib/text/case.md): Identifier case conversions across camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, and kebab-case. - [`/text/cmark`](https://tangu.dev/stdlib/text/cmark.md): CommonMark and GitHub Flavored Markdown compiler (to-html) supporting tables, strikethrough, and task lists. - [`/i18n`](https://tangu.dev/stdlib/i18n.md): Unicode CLDR internationalization powered by ICU4X: locale-aware numbers, currencies, dates, plurals, collation, and grapheme segmentation. - [`/i18n/context`](https://tangu.dev/stdlib/i18n/context.md): Dynamic locale scoping and translated message lookup context (t, with-locale) for multilingual applications. - [`/html`](https://tangu.dev/stdlib/html.md): HTML entity escaping, attribute sanitization, and tag stripping for safe user-generated content. ### System, filesystem & I/O ([Markdown](https://tangu.dev/stdlib-system.md)) - [`/fs`](https://tangu.dev/stdlib/fs.md): Filesystem operations: reading, writing, copying, moving, recursive tree listing, glob matching, and path canonicalization. - [`/io`](https://tangu.dev/stdlib/io.md): Buffered and standard stream I/O (Buf-Reader, Buf-Writer, Stdin, Stdout, Stderr, read-line, write-line, flush, and ask). - [`/path`](https://tangu.dev/stdlib/path.md): Cross-platform lexical path manipulation: dirname-of, file-name, extension-of, stem-of, join, and normalize. - [`/os`](https://tangu.dev/stdlib/os.md): Host operating system, CPU architecture, hostname, and environment introspection. - [`/os/well-known`](https://tangu.dev/stdlib/os/well-known.md): Cross-platform XDG / OS standard directories (config-dir, cache-dir, data-dir, home-dir, download-dir). - [`/process`](https://tangu.dev/stdlib/process.md): Subprocess execution (run, spawn), environment variables (env, env-vars), working directory, and exit statuses. - [`/runtime`](https://tangu.dev/stdlib/runtime.md): Multi-threaded Tokio async runtime construction and blocking entry points (Async-Runtime, run, block-on). - [`/thread`](https://tangu.dev/stdlib/thread.md): OS thread spawning, parallel execution, sleeping, and synchronization. - [`/coro`](https://tangu.dev/stdlib/coro.md): Cooperative coroutines (spawn, await, await-all, sleep) and typed channels (channel, send, recv) backed by Tokio. - [`/tracing`](https://tangu.dev/stdlib/tracing.md): Structured diagnostic logging (trace, debug, info, warn, error) with pluggable observer sinks. - [`/panic`](https://tangu.dev/stdlib/panic.md): Diverging development and assertion helpers (todo!, unimplemented!, unreachable!). ### Data, codecs & validation ([Markdown](https://tangu.dev/stdlib-data.md)) - [`/codec/json`](https://tangu.dev/stdlib/codec/json.md): Fast bidirectional JSON serialization (encode, decode, from-json) and derivable To-JSON / From-JSON support. - [`/codec/cbor`](https://tangu.dev/stdlib/codec/cbor.md): Compact Concise Binary Object Representation (CBOR, RFC 8949) encoder and decoder for Tangu values. - [`/codec/uri`](https://tangu.dev/stdlib/codec/uri.md): Percent-encoding and application/x-www-form-urlencoded query-string serialization. - [`/csv`](https://tangu.dev/stdlib/csv.md): RFC 4180 CSV parser and serializer supporting tuple rows and header-mapped records. - [`/base64`](https://tangu.dev/stdlib/base64.md): RFC 4648 standard and URL-safe Base64 encoding and decoding for strings and byte slabs. - [`/validation`](https://tangu.dev/stdlib/validation.md): Declarative Struct field constraint validation (#{:min-len ... :format :email ...}) returning ValidationErrors. - [`/glue/date-util`](https://tangu.dev/stdlib/glue/date-util.md): Business-day calendar helpers for workdays, weekends, and nth-weekday offset calculations. - [`/glue/fs-util`](https://tangu.dev/stdlib/glue/fs-util.md): High-level directory tree copying, filename sanitization, and parent directory initialization. - [`/glue/gen-util`](https://tangu.dev/stdlib/glue/gen-util.md): Code generation banner and header formatting helpers. ### Time, date & scheduling ([Markdown](https://tangu.dev/stdlib-time.md)) - [`/chrono`](https://tangu.dev/stdlib/chrono.md): 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. - [`/calendar/gregorian`](https://tangu.dev/stdlib/calendar/gregorian.md): Pure Gregorian calendar arithmetic: leap years, days in month, weekday indices, and date comparison. - [`/cron`](https://tangu.dev/stdlib/cron.md): Standard 5-field cron expression parsing, validation, and schedule matching (Cron, is-matching?, is-matching-now?). ### Web, HTTP & full-stack apps ([Markdown](https://tangu.dev/stdlib-web.md)) - [`/http`](https://tangu.dev/stdlib/http.md): Shared HTTP method, status code, content-type, and request/response inspection predicates. - [`/http/client`](https://tangu.dev/stdlib/http/client.md): Async and sync HTTP/HTTPS client with connection pooling, headers, timeouts, and streaming bodies. - [`/http/client/json`](https://tangu.dev/stdlib/http/client/json.md): Convenience helpers for sending JSON HTTP requests and decoding structured responses (post-json). - [`/http/server`](https://tangu.dev/stdlib/http/server.md): High-performance Axum/Tokio HTTP/1.1 & HTTP/2 server supporting static serving, SSE, multipart forms, and WebSockets. - [`/web/app`](https://tangu.dev/stdlib/web/app.md): Core full-stack web application primitives: cookies, flash messages, query/form params, responses, and trie router. - [`/web/app/server`](https://tangu.dev/stdlib/web/app/server.md): Opinionated HTTP server launcher reading HOST and PORT from process environment variables. - [`/web/app/handlers`](https://tangu.dev/stdlib/web/app/handlers.md): Composable HTTP request handlers: chain-handlers, route-map, route-fs, route-graph, handle-html, handle-css, handle-not-found. - [`/web/app/middleware`](https://tangu.dev/stdlib/web/app/middleware.md): Production HTTP middlewares: CSRF, CORS, session, rate limiting, security headers, auth, tracing, and scripts injection. - [`/web/app/forms`](https://tangu.dev/stdlib/web/app/forms.md): HTML form binding, type coercion, CSRF token fields (), and field validation errors (). - [`/web/app/session`](https://tangu.dev/stdlib/web/app/session.md): Cookie-backed and server-side session state management. - [`/web/app/graph`](https://tangu.dev/stdlib/web/app/graph.md): Filesystem-driven application route graph (App-Graph) for breadcrumbs, navigation trails, and static site crawling. - [`/web/app/graph/sitemap`](https://tangu.dev/stdlib/web/app/graph/sitemap.md): XML and plain-text sitemap generators and HTTP handlers constructed from an App-Graph. - [`/web/app/graph/openapi`](https://tangu.dev/stdlib/web/app/graph/openapi.md): Automatic OpenAPI 3.1 specification generator from /web/app route graphs and Struct schemas. - [`/web/push`](https://tangu.dev/stdlib/web/push.md): RFC 8291 Web Push payload encryption and VAPID key generation. - [`/websocket/client`](https://tangu.dev/stdlib/websocket/client.md): WebSocket client supporting text and binary frames, ping/pong, and graceful close. ### CLI, terminal, markup & browser DOM ([Markdown](https://tangu.dev/stdlib-terminal-ui.md)) - [`/cli`](https://tangu.dev/stdlib/cli.md): Declarative command-line argument and subcommand router DSL (action, query, cmd, scope, mount) with automatic help output. - [`/tty`](https://tangu.dev/stdlib/tty.md): Terminal capability detection, dimensions, raw mode controls, and interactive prompt helpers. - [`/ansi`](https://tangu.dev/stdlib/ansi.md): ANSI terminal escape sequences for foreground/background styling, 256-color/RGB output, and text weights. - [`/color`](https://tangu.dev/stdlib/color.md): Color space conversions (hex, RGB, HSL, OKLCH), WCAG contrast ratios, and tonal palette operations. - [`/repr/html`](https://tangu.dev/stdlib/repr/html.md): SHTML (#shtml / #html) node renderer, attribute/class utilities, and template formatter (format-html). - [`/repr/css`](https://tangu.dev/stdlib/repr/css.md): CSS AST compiler and nested stylesheet formatter (format-css, scss->css) powering #css blocks. - [`/repr/js/dom`](https://tangu.dev/stdlib/repr/js/dom.md): Typed Browser DOM and Document/Element interop bindings when compiling Tangu to JavaScript. - [`/repr/js/web`](https://tangu.dev/stdlib/repr/js/web.md): Typed Web Platform API bindings (fetch, Storage, History, Workers, URL, WebSocket) for the JavaScript target. ### PostgreSQL & SQLite databases ([Markdown](https://tangu.dev/stdlib-database.md)) - [`/postgres/client`](https://tangu.dev/stdlib/postgres/client.md): Pooled PostgreSQL client with primary/replica routing, strong consistency reads (query-strong, query-one-strong), and ACID transactions. - [`/sqlite/client`](https://tangu.dev/stdlib/sqlite/client.md): Synchronous embedded SQLite connection pool with parameterized queries, row maps, and closure transactions (begin). ### Security, hashing & cryptography ([Markdown](https://tangu.dev/stdlib-security.md)) - [`/crypto`](https://tangu.dev/stdlib/crypto.md): Cryptographic hashing (SHA-256), HMAC authentication, AES-GCM/AEAD helpers, CSPRNG tokens, and constant-time equality. - [`/crypto/ecdsa`](https://tangu.dev/stdlib/crypto/ecdsa.md): Elliptic Curve Digital Signature Algorithm (ECDSA) P-256 key generation, signing, and signature verification. - [`/crypto/rsa`](https://tangu.dev/stdlib/crypto/rsa.md): RSA public/private key parsing, PKCS#1/PSS signing, and cryptographic signature verification. - [`/hash`](https://tangu.dev/stdlib/hash.md): Fast non-cryptographic hash algorithms: AHash, FNV-1a, SipHash-1-3, and XXHash64. - [`/jwt`](https://tangu.dev/stdlib/jwt.md): JSON Web Token (JWT) HS256 signing and verification (sign-jwt, verify-jwt). - [`/uuid`](https://tangu.dev/stdlib/uuid.md): RFC 9562 UUIDv4 (random) and UUIDv7 (time-ordered) generation and validation. ### Mathematics, SIMD & image codecs ([Markdown](https://tangu.dev/stdlib-math-media.md)) - [`/math`](https://tangu.dev/stdlib/math.md): Mathematical constants (pi, e, phi) complementing the prelude math intrinsics. - [`/num`](https://tangu.dev/stdlib/num.md): Numeric interpolation (lerp) and rounding-to-multiple utilities. - [`/statistics`](https://tangu.dev/stdlib/statistics.md): Descriptive and rolling statistics: mean, weighted-mean, variance, standard deviation, change metrics, and moving averages. - [`/mat`](https://tangu.dev/stdlib/mat.md): 4x4 floating-point matrix math (Mat4) for 3D transforms, projections, rotations, and inversions. - [`/simd`](https://tangu.dev/stdlib/simd.md): Portable 128-bit SIMD vector types (F32x4, F64x2, I32x4, I64x2, U8x16) with lane-parallel arithmetic. - [`/rng`](https://tangu.dev/stdlib/rng.md): Pseudo-random number generation for bounded integers, floats, booleans, and collection sampling. - [`/image`](https://tangu.dev/stdlib/image.md): In-memory raster Image decoding/encoding with format detection, cropping, and high-quality resizing. - [`/image/avif`](https://tangu.dev/stdlib/image/avif.md): AVIF image decoder and encoder for files and byte slabs. - [`/image/jpeg`](https://tangu.dev/stdlib/image/jpeg.md): JPEG image decoder and encoder with configurable quality for files and byte slabs. - [`/image/png`](https://tangu.dev/stdlib/image/png.md): Lossless PNG image decoder and encoder for files and byte slabs. - [`/image/webp`](https://tangu.dev/stdlib/image/webp.md): WebP image decoder and encoder for files and byte slabs.