Comment by svieira

3 years ago

Dhall and Cue come to mind as ones that _feel_ more designed

https://github.com/dhall-lang/dhall-lang

https://cuelang.org/docs/usecases/configuration/

Interesting...

Me, the programmer finds those kinda cool.

And the sysadmin in me developed a dislike of both within 1 minute of looking at them.

Honestly, I think a good configuration library should be more than a spec, it should come with a library that handles parsing/validation. See, there are two sides to configuration, the user and the program. Knowledge about the values, defaults and types should live on the program side and should be documented. Then the user side of configuration can be clean and easy to read/write and most important of all, allow the user to accomplish the most common configuration without having to learn a new config language on top of learning the application.

  • > Honestly, I think a good configuration library should be more than a spec, it should come with a library that handles parsing/validation

    You just described CUELang.

    The type system allows to define a schema as well as the data, in the same file, or in 2 separate ones. Then you can call either a cli tool (that works on linux, windows or mac) or use the Go lib (or bind to it).

    For compat, cue can import and export to yaml, json and protobuf, as well as validate them.