A high-performance YAML 1.2 and JSON parser/emitter for C with zero-copy operation, generics, and reflection-based serdes.
libfyaml is a high-performance, feature-complete YAML 1.2 and JSON parser and emitter library written in C. It provides multiple API layers—core, generic, and reflection—for parsing, emitting, and manipulating structured data with zero-copy operation and full compliance with the YAML specification. It solves the problem of efficiently working with YAML and JSON in C applications, from low-level document control to high-level typed serialization.
C developers who need to parse, emit, or manipulate YAML or JSON data, particularly those working on configuration systems, data serialization, or tools requiring interoperability with YAML/JSON formats.
Developers choose libfyaml for its comprehensive feature set, including zero-copy parsing, a Python-like generic API for flexible data handling, and reflection-based typed serdes for stable C structs. Its MIT license, full YAML 1.2 compliance, and multi-layer design make it a versatile and performant alternative to other YAML libraries.
Fully feature complete YAML parser and emitter, supporting the latest YAML spec and passing the full YAML testsuite.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Passes the entire YAML test suite, ensuring reliable parsing and emission for configuration and data interchange tasks, as stated in the README.
Core parsing paths use zero-copy operation, enhancing efficiency for large YAML and JSON documents, a key feature highlighted in the description.
Offers core, generic, and reflection APIs, allowing developers to choose the right level of control or convenience, as emphasized in the philosophy section.
Includes a Python binding that mirrors the C generic API, enabling seamless prototyping and cross-language data modeling, demonstrated in the examples.
Reflection API provides direct serialization and deserialization between YAML and native C structs using type metadata, solving schema-driven workflows.
As version 1.0-alpha4, it's not stable, with potential breaking changes and bugs, as evidenced by recent packaging fixes mentioned in the README.
Optional dependencies like libclang for reflection authoring, and documentation builds require Sphinx and LaTeX, adding setup overhead and complexity.
Three distinct API layers (core, generic, reflection) require developers to understand which to use, increasing initial effort and decision fatigue.
Being a newer project, it has fewer community resources, tutorials, and support compared to established libraries like yaml-cpp or libyaml.