# ayaml > Pure-Rust YAML 1.2.2 parser, Serde codec, spanned event stream, deterministic emitter, and source-preserving editor. - Crate version: `ayaml 1.0.0` (companion crate: `ayaml-edit 1.0.0`) - MSRV: Rust 1.88 - Safety: `#![forbid(unsafe_code)]` across published workspace crates - Direct runtime dependencies: `serde`, `indexmap` - Repository: https://github.com/asamarts/ayaml - Crates: https://crates.io/crates/ayaml and https://crates.io/crates/ayaml-edit - Rustdoc API: https://docs.rs/ayaml and https://docs.rs/ayaml-edit ## Performance summary (pinned release v1.0.0, 2026-12-01, 3 rounds) - Geometric mean across shared `ayaml-fixtures` workloads (26 timed fixtures, 26 memory fixtures, standalone comparative harness: https://github.com/asamarts/ayaml-benchmarks): - `ayaml value` is 2.12x faster than `yaml-rust2`, 2.44x faster than `saphyr`, 3.08x faster than `yaml-serde` (5.1x fewer allocations, 4.57x lower peak heap), 4.98x faster than `serde-saphyr` (targeting `serde_json::Value`), 1.87x faster than C++ `fkYAML`, and matches `astral-yaml` `Value` CPU (0.99x) at 3.85x lower peak heap. - Safe flat-array `ayaml tape` (`parse_tape` / `parse_tape_documents`) runs 1.43x faster than `ayaml value` (1.46x with `ParserBuf` reuse) with 1.51x lower peak heap (3.75x lower than C++ `rapidyaml`) and 140x fewer heap allocations (1.42x faster and 5.89x lower peak heap than `astral-yaml` `Value`). - Public pull-based `ayaml::parse_events` is 1.72x faster than C `libyaml` events (1.56x excluding `large-scalar-1mb`, with 1.97x lower peak heap and 669x fewer allocations) and 2.78x faster than C `libfyaml` events. - On the 1 MiB plain scalar (`large-scalar-1mb`), `ayaml::parse_events` reaches 2456.2 MiB/s (1.56x vs C `libfyaml` events at 1575 MiB/s and 8.46x vs C++ `rapidyaml`); deterministic emission reaches up to 242.0 MiB/s. - Benchmarks: https://asamarts.github.io/ayaml/benchmarks/ - Parsing modes & benchmark concepts: https://asamarts.github.io/ayaml/parsing-modes/ ## Documentation pages - [Introduction](https://asamarts.github.io/ayaml/docs/): ayaml is a pure-Rust YAML 1.2.2 parser, spanned event stream, generic value model, Serde codec, and deterministic emitter. ### Guide - [Getting started](https://asamarts.github.io/ayaml/docs/getting-started/): Parse YAML into Value trees or typed Serde structs, stream multiple documents, inspect spans, emit YAML, and enforce resource limits with masked errors. - [Cookbook](https://asamarts.github.io/ayaml/docs/cookbook/): Self-contained recipes for common tasks in ayaml. Every Rust example on this page is compiled and executed as part of the workspace test suite. - [Source-preserving editing (ayaml-edit)](https://asamarts.github.io/ayaml/docs/editing/): When updating an existing YAML configuration file (such as a CI workflow, manifest, or lockfile), deserializing and re-emitting the entire document strips... - [Sizing resource limits](https://asamarts.github.io/ayaml/docs/limits-sizing/): ayaml applies resource limits on every parse and emit call so untrusted YAML cannot exhaust memory or stack space. The defaults are chosen for general... - [Format contract and interface](https://asamarts.github.io/ayaml/docs/interface/): ayaml and adotenv are independent parsers that keep their public surfaces consistent through a format contract: no shared types, no shared trait, and no... - [Compatibility profile](https://asamarts.github.io/ayaml/docs/compatibility/): ayaml has one default parsing profile and one optional compatibility mode. ### Migrating - [From serde_yaml](https://asamarts.github.io/ayaml/docs/migrating-from/serde-yaml/): serde_yaml (archived upstream) wrapped C-transpiled unsafe-libyaml with YAML 1.1 heuristics and unbounded alias expansion by default (while enforcing a... - [From serde_yml, serde_yaml_ng, and yaml-serde](https://asamarts.github.io/ayaml/docs/migrating-from/serde-yml-and-forks/): serde_yml (deprecated and unmaintained upstream, RUSTSEC-2025-0068), serde_yaml_ng, and yaml-serde are forks of serde_yaml backed by unsafe C-transpiled... - [From yaml-rust2, saphyr, and serde-saphyr](https://asamarts.github.io/ayaml/docs/migrating-from/yaml-rust2-and-saphyr/): yaml-rust2, saphyr, and serde-saphyr are pure-Rust YAML 1.2 libraries. ayaml brings event scanning, generic Value DOM, spanned trees, owned and borrowed... - [From YAML 1.1](https://asamarts.github.io/ayaml/docs/migration/): ayaml follows YAML 1.2.2 by default. Teams moving from YAML 1.1 stacks or libyaml-based pipelines usually run into five differences: scalar typing... - [Real-world migration validation](https://asamarts.github.io/ayaml/docs/real-world-migrations/): Before freezing the ayaml 1.0.0 API, we migrated five widely used, open-source Rust projects from five different YAML stacks (yaml-rust2, serde-saphyr... ### Reference - [Correctness and verification](https://asamarts.github.io/ayaml/docs/correctness/): ayaml verifies parser, serializer, and editor correctness across eight layers, from zero-unsafe compilation to fuzzing, Miri, and Kani formal proofs. - [API reference and caveats](https://asamarts.github.io/ayaml/docs/api-reference/): Complete Rustdoc signatures and trait implementations are published on docs.rs. - [Error codes](https://asamarts.github.io/ayaml/docs/error-codes/): Every Error returned by ayaml carries an ErrorKind (pipeline stage) and a stable ErrorCode (yaml.). - [Security and untrusted input](https://asamarts.github.io/ayaml/docs/security/): ayaml parses untrusted YAML input with explicit resource limits and masked error formatting for secret-bearing documents. This page documents what ayaml... - [Stability and versioning](https://asamarts.github.io/ayaml/docs/stability/): ayaml follows Semantic Versioning 2.0.0. Within the 1.x release line, every minor and patch release is strictly additive and backwards-compatible for... - [Resource limits](https://asamarts.github.io/ayaml/docs/limits/): YAML input can be attacker-controlled. ayaml therefore makes resource limits part of the parser API rather than an optional wrapper. ### Engineering - [Benchmark methodology](https://asamarts.github.io/ayaml/docs/benchmarks/): ayaml includes deterministic fixtures, timing benchmarks, counting-allocator probes, steady-state Callgrind checks, and a cargo xtask CLI so that... - [Developer tooling and verification](https://asamarts.github.io/ayaml/docs/tools/): ayaml ships with a reproducible verification stack covering YAML 1.2.2 conformance, performance and memory regression gates, fuzzing, formal verification... - [Design](https://asamarts.github.io/ayaml/docs/design/): ayaml exposes one YAML implementation through several APIs. The goal is not a minimal "YAML-like" configuration reader: the parser, resolver, composer... - [Dependency policy](https://asamarts.github.io/ayaml/docs/dependencies/): ayaml keeps its runtime dependency graph small and does not delegate YAML parsing to another parser. - [Design decisions](https://asamarts.github.io/ayaml/docs/decisions/): Technical decisions made since this repository became the development home. Each record states what was decided and why, so a later reader can tell whether... - [Open issue priorities](https://asamarts.github.io/ayaml/docs/issue-priorities/): This page tracks active issue queues grouped by root cause so related fixes are tested together. All pre-1.0 queues are clear; please report new bugs or... ## Full text bundle - [llms-full.txt](https://asamarts.github.io/ayaml/llms-full.txt)