Live data from Hacker News

Levels of configuration languages

beza1e1.tuxen.de

1–10 of 69 posts

Re: Levels of configuration languages

#4
I'm not convinced by reducing this to a single dimension. There are differences in both 'what can be expressed' and 'what validation can be done' which are somewhat independent of each other

Re: Levels of configuration languages

#5
> Don't waste time on discussions within a level.

I disagree with this. YAML has too many footguns (boolean conversions being the first among them) not to mention it is a superset of JSON. Plain old JSON or TOML are much simpler.

Re: Levels of configuration languages

#6
That’s a good breakdown.

In practice configuration systems that reach level 4 or 5 start to look complex and the whole thing ends up with a new rewrite into a level 2 or 3. After a while it expands, because it needs comments, include files, templating, for loops, etc., until it becomes a total mess and gets thrown out and we cycle back to level 3.

Re: Levels of configuration languages

#7
About 20 or so years ago, I have come across a configuration pattern that could be arguably called "Level 0". It was configuration by file existence. The file itself would be typically empty. So no parsing, syntax, or schema involved. For example, if the file /opt/foo/foo.txt exists, the software does one thing but if it is missing the software does another thing. So effectively, the existence of the file serves as a boolean configuration flag.

Re: Levels of configuration languages

#8
post #3

The distance between 3 and 4 are wider and have more members. Take CSS for example.

CSS is at least level 4. You can even argue for level 5, i.e. Turing-complete: https://stackoverflow.com/questions/2497146/is-css-turing-co...

Level 4 is turing complete.

There's two parts that I was talking about. Things that are not quite that and the fact that configuration can have that capability in a fairly useless context.

When I'm dealing with personal things or stuff that few people use I will often make the configuration just something I eval/source.

So it in theory has the same functionality as the underlying programming language, but in practice you're just supposed to use it like an INI.

Here's a fairly large personal project where I use that

https://github.com/kristopolous/music-explorer

It actually allowed me to change the behavior on whether I'm running my program from my office or home. So invoking the full fidelity of the underlying language actually has its benefits at times.

Post reply on HN