News for hackers. Stuff that matters.
Re:How I learned to stop worrying and love the YAML by nicoburns on Monday May 16, 2022 @11:33AM (#31398941)
I've been thinking about what make a good language for configuration files, and the conclusion I've come to is that it ought to have:

- Local variables

- Pure functions with basic math and string manipulation capabilities

Possibly with an extended version that also has:

- Input variables (that must be provided by the code reading the file)

- Exportable functions that are callable by the host code

This extended version would be perfect for use cases like defining CI pipelines.

A language that did this but was otherwise simple and allowed no access to the host system, and had widely available library support across most common languages would be just awesome.

Re:How I learned to stop worrying and love the YAML by marcosdumay on Monday May 16, 2022 @12:32PM (#31399853)
Something like Dhal?

https://dhall-lang.org/

From what I hear people saying I'd guess its main usage is being a general purpose language that creates those shitty YAML based formats as outputs.

Anyway, I'm in complete agreement with the article. CI pipelines and infrastructure as code should both be defined in code, real code. Configuration files are the place you set the values for your variables, not the place you do calculations with them.

Re:How I learned to stop worrying and love the YAML by wvenable on Monday May 16, 2022 @12:31PM (#31399845)
In my own applications, I've moved away from configuration files as much as possible. Instead, I provide an API and all my configuration is just code.

I think creating an entirely new Turing-complete language just for configuration is a waste of brain cells for everyone involved.

Re:How I learned to stop worrying and love the YAML by tylergetsay on Monday May 16, 2022 @12:28PM (#31399798)
JavaScript tools and their .js config files work great for this

That being said, if you're only evaluating the file one time, just write a script to spit out your config.

Re:How I learned to stop worrying and love the YAML by exyi on Monday May 16, 2022 @01:18PM (#31400516)
One of the reasons to like Nix. However, having something majority of people can understand is usually the more important concern...
Re:How I learned to stop worrying and love the YAML by ChiefOBrien on Monday May 16, 2022 @01:11PM (#31400438)
Lua