# Tom's Obvious Minimal Language (TOML) TOML (Tom's Obvious Minimal Language) is a configuration file format created by [[Tom Preston-Werner]] (co-founder of GitHub) in 2013. Designed to be easy to read due to obvious semantics, TOML maps unambiguously to a hash table and prioritizes human readability over flexibility. Unlike [[Yet Another Markup Language (YAML)|YAML]], TOML avoids whitespace-sensitivity and complex features that can lead to parsing ambiguities. It has become popular for configuration files in modern tools, notably Rust's `Cargo.toml`, Python's `pyproject.toml`, and various other project configuration files. ## Key Characteristics - **Minimal syntax**: Simple, obvious rules - **No whitespace sensitivity**: Indentation is optional/cosmetic - **Strong typing**: Explicit date/time, integer, float, boolean types - **Comments supported**: Using `#` - **Unambiguous**: Maps directly to hash tables - **Case-sensitive keys**: Unlike some formats ## Syntax Examples ```toml # This is a comment title = "My Project" version = "1.0.0" [owner] name = "Tom Preston-Werner" date_of_birth = 1979-05-27T07:32:00-08:00 [database] enabled = true ports = [8000, 8001, 8002] temp_targets = { cpu = 79.5, case = 72.0 } [[servers]] name = "alpha" ip = "10.0.0.1" [[servers]] name = "beta" ip = "10.0.0.2" ``` ## Common Uses - **Rust**: `Cargo.toml` for package management - **Python**: `pyproject.toml` (PEP 518, PEP 621) - **Go**: Various tools and configurations - **Static site generators**: Hugo, Zola - **General configuration**: Application settings ## TOML vs YAML vs JSON | Aspect | TOML | YAML | JSON | |--------|------|------|------| | Readability | High | High | Medium | | Comments | Yes | Yes | No | | Whitespace | Not significant | Significant | Not significant | | Complexity | Low | High | Low | | Use case | Config files | Config, data | Data interchange | ## References - https://toml.io - https://github.com/toml-lang/toml - https://en.wikipedia.org/wiki/TOML ## Related - [[Tom Preston-Werner]] - [[Yet Another Markup Language (YAML)]] - [[JavaScript Object Notation (JSON)]] - [[Rust]]