Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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.


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.


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.


One of the reasons to like Nix. However, having something majority of people can understand is usually the more important concern...


Lua




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: