Standard Library
Comprehensive documentation for the Hoon standard library.
The Hoon standard library provides a complete suite of functions for working with the fundamental data types and operations in Hoon. These functions are organized into numbered sections based on their purpose and the types they operate on. The numbering corresponds to the layer structure in /sys/hoon.hoon
.
Layer 1: Basic Operations
1a: Basic Arithmetic - Unsigned arithmetic operations including addition, subtraction, multiplication, division, and comparison functions.
1b: Tree Addressing - Functions for addressing and navigating tree structures using Nock's tree addressing scheme.
1c: Containers - Fundamental container types and molds including
+pair
,+list
,+unit
,+tree
,+gate
, and other essential type definitions.
Layer 2: Data Structures and Operations
Unit and List Operations
2a: Unit Logic - Functions for working with units (optional values).
2b: List Logic - List manipulation functions.
Bit and Logic Operations
2c: Bit Arithmetic - Functions for assembling, disassembling, and manipulating atoms at the bit level.
2d: Bit Logic - Bitwise logical operations including binary AND, OR, XOR, and bit manipulation.
2e: Insecure Hashing - Non-cryptographic hash functions including MurmurHash and other fast hashing algorithms.
2f: Noun Ordering - Functions for ordering and comparing nouns.
2g: Unsigned Powers - Exponentiation and power-related operations for unsigned integers.
Container Data Structures
2h: Set Logic - Set data structure operations including union, intersection, difference, and membership testing.
2i: Map Logic - Functions for working with key-value maps, including insertion, deletion, lookup, and map transformations.
2j: Jar and Jug Logic - Operations for jar (map of lists) and jug (map of sets) data structures.
2k: Queue Logic - Queue data structure operations for first-in, first-out data handling.
2l: Container from Container - Functions for transforming one container type into another.
2m: Container from Noun - Functions for creating containers from raw noun data.
2n: Functional Hacks - Utility functions and functional programming helpers.
2o: Normalizing Containers - Additional container types and operations.
2p: Serialization - Functions for serializing and deserializing data structures.
2q: Molds and Mold-builders - Type construction and validation functions for creating and working with Hoon types.
Layer 3: Advanced Operations
3a: Signed and Modular Arithmetic - Signed integer arithmetic and modular arithmetic operations.
3b: Floating Point - Floating-point arithmetic operations.
3c: Urbit Time - Time and date manipulation functions specific to Urbit's
@da
datetime format.3d: SHA Hash Family - Cryptographic hash functions from the SHA family.
3e: AES Encryption - Advanced Encryption Standard functions (removed from current stdlib).
3f: Scrambling - Functions for data scrambling, obfuscation, and pseudo-random transformations.
3g: Molds and Mold-builders - Advanced type system operations and mold construction utilities.
Layer 4: Text Processing and I/O
4a: Exotic Bases - Functions for converting between different number bases and representations.
4b: Text Processing - String and text manipulation functions including parsing and formatting.
4c: Tank Printer - Pretty-printing functions for structured output and debugging.
4d: Parsing (Tracing) - Parsing utilities with tracing support for debugging parser errors.
4e: Parsing (Combinators) - Parser combinator functions for building complex parsers.
4f: Parsing (Rule Builders) - Functions for building parsing rules and grammar definitions.
4g: Parsing (Outside Caller) - Interface functions for calling parsers from external code.
4h: Parsing (ASCII Glyphs) - Parsers for ASCII characters and common text symbols.
4i: Parsing (Useful Idioms) - Common parsing patterns and idiomatic parser constructions.
4j: Parsing (Bases and Base Digits) - Parsers for numbers in various bases and digit representations.
4k: Atom Printing - Functions for converting atoms to various textual representations.
4l: Atom Parsing - Functions for parsing text into atoms with various auras.
4m: Formatting Functions - Text formatting and pretty-printing utilities.
4n: Virtualization - Virtualization and abstraction utilities for code execution.
4o: Molds and Mold-builders - Advanced mold operations and type system utilities for complex type manipulation.
Layer 5: Compiler and System Operations
5a: Compiler Utilities - Utilities and helper functions used by the Hoon compiler.
5b: Macro Expansion - Functions for macro expansion and code transformation.
5c: Compiler Backend - Backend compilation functions and code generation utilities.
5d: Parser - Core parsing functions for the Hoon language syntax.
5e: Molds and Mold-builders - System-level type operations and mold construction.
5f: Profiling Support - Profiling tools and debugging utilities for performance analysis.
Last updated