Popeye-style illustration saying I YAM WHAT I YAM, from the days when Oyl was named yam

Oyl

spinach-powered parsing

YAML 1.2 | C11 GitHub Repo API Docs

The optimized YAML library: a fast, minimal, zero-copy parser and emitter for YAML 1.2, with SIMD scanning, event-driven parsing, merge and alias support, and dependable error reporting.

Fuzzies parsed

Random inputs ClusterFuzzLite has thrown at Oyl since September 24, 2026, under AddressSanitizer and UndefinedBehaviorSanitizer, each checked for crashes, memory errors and round-trip mistakes. Counted from the fuzzing logs after every run.

308/308Valid suite cases
94/94Invalid rejected
970Tests

Build and Run

Build with a C11 compiler (GCC/Clang tested on Linux and macOS).

make              # build liboyl.a
make test-all     # run all tests
make test-suite   # run YAML Test Suite (needs submodules)
make bench        # scanner benchmark on your machine

Core Capabilities

Scanner

SIMD-accelerated tokenization (SSE4.2 with scalar fallback), producing a flat token stream.

Parser

Event API with indent tracking, block structure handling, merge key expansion, alias resolution, and event safety limits.

Emitter

Roundtrip output in block, flow, or minimal style, with auto-quoting for ambiguous plain scalars.

Schema support: Failsafe, JSON, Core, or fully custom resolution rules.

Architecture

Oyl keeps scanner and parser responsibilities clean: raw tokens first, structure and properties in parser, then emit text.

Input Bytes
Scanner
Tokens
Parser
Events
Emitter

Quick API Snapshot

Event Loop

const oyl_event *evt;
while (oyl_parse_next(parser, &evt) == OYL_OK) {
  if (evt->type == OYL_EVT_STREAM_END) break;
  /* consume event */
}

Error Reporting

if (oyl_parse_next(parser, &evt) != OYL_OK) {
  const char *msg = oyl_parser_error(parser);
  oyl_mark mark = oyl_parser_error_mark(parser);
  printf("%zu:%zu: %s\n", mark.line, mark.col, msg);
}

Benchmarks

Parse throughput in MB/s on one core, higher is better. Every parser reads the same bytes; each panel has its own scale.

Show the numbers

All results were measured here with make bench-compare: Intel Core Ultra 7 155H, one core, GCC 16.2 -O2, median of 11 runs in each of 3 passes, October 2026. The real-file and long-text inputs are rapidyaml’s own benchmark files. All four are measured as event parsers: Oyl, libyaml 0.2.5, libfyaml 0.9.6, and rapidyaml 0.16 through its event parser with buffers reused between parses, its fastest mode, rather than its usual API, which builds a tree. Run it on your own machine, or see the README for details.

Conformance: exact event streams for all 308 valid YAML Test Suite cases and all 94 invalid ones rejected, in both parser modes; every valid case round-trips through the emitter. 970 tests, 0 failures.