Pudu programming language
Menu
Reference

Pudu standard library

Author
Chris M. Pérez Santiago
Version
0.1.0
Contents
173 modules, 3456 public declarations

The standard library ships with the compiler. Every module lives under Std, nothing is imported implicitly, and a program imports exactly the modules it uses. Pick a section, or search by name or type from the top of any page.

Core values

The types every program uses: optional values, results, characters, comparisons, and the traits behind them.

Std.Option

24 declarations

A value that may be absent: Some(value) or None.
Std.Result

24 declarations

Work that may fail: Ok(value) or Err(problem).
Std.Bool

10 declarations

Combining truth values across arrays.
Std.Char

29 declarations

Single characters: classes, case, and digits.
Std.Tuple

10 declarations

Pairs and the functions that take them apart.
Std.Function

14 declarations

Functions as values: composition, identity, and application.
Std.Order

49 declarations

Comparisons, orderings, and sort predicates.
Std.Show

12 declarations

Rendering values as text.
Std.Num

15 declarations

The traits behind arithmetic.
Std.Mappable

3 declarations

Containers whose values can be replaced.

Text

Searching, building, parsing, and formatting text.

Std.Text

66 declarations

Searching, splitting, trimming, and reading numbers from text.
Std.Fmt

18 declarations

Padding, alignment, and number formatting.
Std.Regex

18 declarations

Regular expressions with a step limit.
Std.Glob

6 declarations

Shell-style wildcard patterns.
Std.Diff

7 declarations

Line differences and unified diff hunks.
Std.Intern

7 declarations

Pools that store each distinct text once.
Std.Semver

12 declarations

Semantic versions: parsing and comparison.
Std.Uuid

12 declarations

Universally unique identifiers.
Std.Validate

20 declarations

Checking form input field by field.

Numbers

Arithmetic past the operators: exact decimals, bit manipulation, randomness, and numeric columns.

Std.Math

34 declarations

Numeric functions for whole and floating numbers.
Std.Decimal

30 declarations

Exact decimal arithmetic and rounding.
Std.Bits

42 declarations

Bitwise operations and bit counts for every integer width.
Std.Random

15 declarations

Seeded pseudo-random numbers.
Std.Column

38 declarations

Element-wise arithmetic over numeric columns.

Collections

Arrays, maps, sets, and the specialised structures for when the ordinary ones are not the right shape. Collections never change in place: every operation answers a new value.

Std.List

97 declarations

Arrays: sorting, grouping, searching, and folding.
Std.Map

47 declarations

Ordered maps from keys to values.
Std.Set

39 declarations

Ordered sets.
Std.Iter

25 declarations

Sequences a for loop can walk.
Std.NonEmpty

29 declarations

Arrays that always hold at least one element.
Std.Deque

21 declarations

Double-ended queues.
Std.Heap

18 declarations

Priority queues.
Std.HashMap

23 declarations

Maps spread across hashed buckets.
Std.SortedMap

31 declarations

Maps kept in key order with range queries.
Std.LinkedMap

27 declarations

Maps that remember insertion order.
Std.FlatMap

10 declarations

Maps from 64-bit keys in one flat table.
Std.IntMap

21 declarations

Maps keyed by whole numbers.
Std.IntSet

23 declarations

Sets of whole numbers.
Std.EnumMap

22 declarations

Maps over a fixed domain of keys.
Std.BiMap

24 declarations

Maps that look up in both directions.
Std.MultiMap

30 declarations

Maps holding several values under one key.
Std.MultiKeyMap

24 declarations

Maps keyed by more than one part.
Std.Tree

40 declarations

Labelled trees addressed by path.
Std.PrefixTrie

25 declarations

Tries for lookups by key prefix.
Std.Graph

22 declarations

Directed graphs and their traversals.
Std.DisjointSet

8 declarations

Union-find over connected components.
Std.FenwickTree

11 declarations

Prefix sums that update in place of a rebuild.
Std.IntervalTree

13 declarations

Finding the intervals that overlap a point or range.
Std.RingBuffer

12 declarations

Fixed-capacity circular buffers.
Std.LruCache

22 declarations

Caches that discard the least recently used entry.
Std.BitSet

18 declarations

Sparse sets of numeric identifiers.
Std.BitVector

18 declarations

Dense vectors of bits.
Std.BloomFilter

12 declarations

Probabilistic membership tests.
Std.RadixSort

2 declarations

Sorting 64-bit integers by their digits.

Files, processes, and time

Everything that talks to the machine a program runs on.

Std.Io

47 declarations

Standard input and output, files, and streaming readers.
Std.Fs

16 declarations

Atomic writes, temporary files, permissions, and metadata.
Std.Path

23 declarations

Building and taking apart file paths.
Std.Env

17 declarations

Arguments, environment variables, and the clock.
Std.Args

21 declarations

Command-line options, checked and typed.
Std.Process

31 declarations

Starting other programs and talking to them.
Std.Signal

4 declarations

Requests from outside the program to stop.
Std.Time

40 declarations

Dates, times, durations, and their text forms.
Std.Log

31 declarations

Structured, levelled logging.
Std.Out

18 declarations

Printing values with a chosen layout.

Data formats

Reading and writing the formats programs exchange.

Std.Json

21 declarations

JSON documents and JSON Lines.
Std.Csv

15 declarations

CSV, read one record at a time.
Std.Toml

18 declarations

TOML configuration.
Std.Yaml

15 declarations

YAML documents.
Std.Xml

21 declarations

XML documents and their attributes.
Std.Mime

8 declarations

Media types and their parameters.

Bytes, hashing, and compression

Binary data, encodings, non-cryptographic hashes, and archives.

Std.Bytes

45 declarations

Byte arrays, slices, hex, and base64.
Std.Buffer

17 declarations

Contiguous, fixed-length byte buffers.
Std.ByteOrder

19 declarations

Big- and little-endian integers.
Std.Hex

8 declarations

Hexadecimal digits and bytes.
Std.Varint

9 declarations

LEB128 variable-length integers.
Std.Adler32

5 declarations

The Adler-32 checksum.
Std.Murmur3

6 declarations

The MurmurHash3 hash.
Std.SipHash

6 declarations

The SipHash keyed hash.
Std.Compress.Gzip

13 declarations

Gzip compression and decompression.
Std.Archive.Tar

8 declarations

Reading and writing tar archives.
Std.Archive.Zip

10 declarations

Reading and writing zip archives.

Networking and the web

Sockets, TLS, HTTP clients and servers, HTML, and mail.

Std.Net

25 declarations

TCP sockets: listening, connecting, reading, and writing.
Std.Tls

18 declarations

Verified TLS connections.
Std.Url

16 declarations

Parsing and building URLs.
Std.Http

104 declarations

HTTP messages, clients, and servers with routing and limits.
Std.Html

45 declarations

HTML built as values and escaped by construction.
Std.Mail

18 declarations

Email addresses, messages, and SMTP delivery.

Applications and databases

The pieces a service is assembled from: configuration, health, sessions, jobs, and SQL databases.

Std.App

32 declarations

An application as a value: settings, stages, health, sessions, and jobs.
Std.Db

28 declarations

SQL for SQLite and PostgreSQL: queries, migrations, and stores.
Std.Crypto

29 declarations

Hashes, message authentication, key derivation, and encryption.
Std.RateLimiter

6 declarations

Token-bucket rate limiting.

Concurrency

Parallel workers, the channels between them, and the state they share.

Std.Concurrent

11 declarations

Starting parallel workers and joining them.
Std.Channel

9 declarations

Bounded channels between workers.
Std.Sync

16 declarations

Mutexes and shared cells.

Interfaces, audio, and video

Drawing, layout, desktop windows, and exact audio and video timing, written in Pudu itself.

Std.Ui

19 declarations

Server events, a software canvas, layout, text, and desktop windows.
Std.Audio

24 declarations

Exact PCM audio, processing graphs, and device playback.
Std.Video

15 declarations

Exact video timing and tracks.

Testing and measuring

Suites that `pudu test` runs, generated properties, and benchmarks.

Std.Test

44 declarations

Test suites and generated properties.
Std.Bench

12 declarations

Measuring how long code takes.