SHCL
Simple Hierarchical Config Language: forgiving to write, predictable to read.
Simple Hierarchical Config Language. Forgiving to write, predictable to read.
Types live in your code rather than in the file, so there is no Norway problem, and one bad line never invalidates the whole file - bad lines are skipped or repaired with diagnostics, and the rest still loads. Hierarchy comes from indentation or from dot notation, freely mixed; both spell the same tree.
It writes as well as reads. A save keeps each comment attached to what it documented, and it refuses to write at all rather than delete a line the load could not keep.
It comes as a complete specification and grammar with one drop-in source file per language: a Rust reference parser plus independent Go, C, and Python bindings, and a CLI with thin Bash and PowerShell wrappers over it. Packages are on crates.io and PyPI, and the Go one is an ordinary Go module. One conformance corpus pins every binding to identical behavior, and a binding is not released until it agrees byte for byte.
Highlights
- Hierarchy by indentation or dot notation, freely mixed.
- Values are typed on read, not on parse. The file stores text; your code asks for an int.
- Never bails on a whole file over one bad line. Every diagnostic has a stable code that tools can match on.
- Full read and write. A save keeps comments in place and never deletes a line someone typed.
- Every convenience read takes a call-site fallback, so a missing value cannot masquerade as a real zero.
- Three strictness levels - loose, standard, strict - as one knob from maximum-forgiving to fail-on-anything.
- Schema validation, layered loading, and commented starter-config generation, all as library features.
- Signed releases, with binaries that can be rebuilt from the tag.