News for hackers. Stuff that matters.
Re:I accidentally used YAML.parse instead of JSON.parse and ... by svieira on Sunday January 23, 2022 @10:01PM (#30053220)
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/

Re:I accidentally used YAML.parse instead of JSON.parse and ... by chillfox on Sunday January 23, 2022 @10:22PM (#30053365)
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.

Re:I accidentally used YAML.parse instead of JSON.parse and ... by BiteCode_dev on Monday January 24, 2022 @07:13AM (#30056688)
> 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.

Re:I accidentally used YAML.parse instead of JSON.parse and ... by stavros on Wednesday January 26, 2022 @04:32AM (#30083485)
Isn't Dhall basically the same (=have the same set of features)?
Re:I accidentally used YAML.parse instead of JSON.parse and ... by BiteCode_dev on Wednesday January 26, 2022 @10:04AM (#30086312)
In the same way python and js are basically the same.
Re:I accidentally used YAML.parse instead of JSON.parse and ... by stavros on Wednesday January 26, 2022 @12:02PM (#30088101)
Exactly. So if I'm going to learn/use one of them, there's no clear winner, really. Both also seem to also have about the same amount of adoption (zero?).
Re:I accidentally used YAML.parse instead of JSON.parse and ... by chillfox on Monday January 24, 2022 @09:32AM (#30058024)
Ok, you have convinced me to give it a serious look.