Back to browse
GitHub Repository

Fully feature complete YAML parser and emitter, supporting the latest YAML spec and passing the full YAML testsuite.

331 starsC

Libfyaml 1.0.0-alpha1, a modern YAML library for C

by fypanto·Mar 18, 2026·7 points·0 comments

AI Analysis

●●SolidWizardryBig BrainNiche Gem

Python-like generics and reflection-based serdes in plain C is genuinely clever.

Strengths
  • Generics API brings Python-like data handling ergonomics to C
  • Reflection subsystem enables typed YAML-to-C struct serialization
  • Zero-copy operation with full YAML 1.2 and JSON spec support
Weaknesses
  • Still alpha release limits immediate production adoption
  • C YAML library space already has libyaml and yaml-cpp
Target Audience

C developers building config-heavy applications

Similar To

libyaml · yaml-cpp · serde_yaml

Post Description

libfyaml is a C library for YAML 1.2 parsing and emission.

I have been working on it for several years as a parser/emitter library, and this alpha is the point where three additional interfaces are being released as public parts of the project.

Part of the motivation for the work is that I think modern C libraries can offer more ergonomic APIs than is often assumed, if they actually use modern C features. C99 is old at this point, and using C11 and newer C2x-era features makes it possible to build interfaces that are still plain C, but are easier to use. You can do tThings like functional-flavored, Python-like data handling and typed serialization based on reflection.

What is new in 1.0.0-alpha1:

- a generic runtime for working with YAML values in C via fy_generic - a reflection subsystem for YAML to C and C to YAML serialization based on C type metadata - Python bindings built on the same generic model - and of course the yaml 1.2 conformant solid core API on top of which all is built upon.

The release also adds the corresponding documentation, examples, tests, and Python wheel packaging.

If you want to try it, the repository includes build instructions for CMake, plus runnable examples for core parsing, generic transforms, parallel generic operations, and reflection-based typed serialization.

The feedback I'm looking for if for a better way to present the generic API or the reflection workflow.

Similar Projects