A C library for parsing and validating configurations in a JSON-compatible language with nginx-like syntax and macros.
UCL (Universal Configuration Language) is a C library for parsing, validating, and emitting configuration files. It provides a human-friendly syntax inspired by nginx while remaining fully compatible with JSON, and supports additional formats like MessagePack and YAML. It solves the problem of writing and maintaining complex configurations by offering a more readable and feature-rich alternative to plain JSON.
System developers, embedded engineers, and application developers who need a robust, flexible configuration parser for C projects, especially those dealing with nginx-like configs or requiring JSON compatibility.
Developers choose UCL for its blend of JSON compatibility and enhanced syntax, which reduces configuration complexity. Its macro system, validation against JSON Schema, and multi-format support make it a versatile choice for projects needing both human-editable and machine-processable configurations.
Universal configuration library parser
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports nginx-like syntax with optional quotes, commas, and relaxed formatting, making configs easier to edit and maintain, as shown in the basic structure examples where 'key = value' is valid.
Fully parses and emits JSON while also handling MessagePack, YAML, and S-Expressions, acting as a drop-in replacement for JSON parsers with added versatility.
Includes macros like .include for external files and validation against JSON Schema draft v4, enabling modular and reliable configuration management for complex setups.
Benchmarks in the README show UCL parsing a 19Mb file in ~0.3 seconds with optimizations, significantly faster than libraries like jansson, making it efficient for large configs.
The .include macro has numerous options (e.g., try, sign, glob, priority) and 16 priority levels, which can be overwhelming and error-prone for straightforward configuration needs.
As a C library, it lacks mature bindings or native support for other programming languages, limiting its appeal in polyglot environments without additional integration effort.
Features like automatic array creation from duplicate keys and named keys hierarchy can lead to unexpected data structures if not carefully managed, risking configuration errors.
YAML write support is described as 'limited' and mainly for compatibility in the README, which may hinder projects relying heavily on YAML for configuration serialization.