Top
Best
New

Posted by kaycebasques 4/12/2025

Levels of configuration languages(beza1e1.tuxen.de)
75 points | 67 commentspage 2
chewbacha 4/13/2025|
Reminds me a lot of the configuration complexity clock: https://mikehadlow.blogspot.com/2012/05/configuration-comple...

It’s made the page before and proposes that these forms are cyclic.

longor1996 4/13/2025|
The article actually (accidentally or on purpose?) refers to just that:

> How to avoid this madness? Introduce another low-level configuration file. Back to level one...

chubot 4/12/2025||
Hm I also made a taxonomy of 5 categories of config languages, which is a bit different

Survey of Config Languages https://github.com/oils-for-unix/oils/wiki/Survey-of-Config-...

    Languages for String Data
    Languages for Typed Data
    Programmable String-ish Languages
    Programmable Typed Data
    Internal DSLs in General Purpose Languages
Their taxonomy is:

    String in a File
    A List
    Nested Data Structures
    Total Programming Languages
    Full Programming Language
So the last category (#5) is the same, the first one is different (they start with plain files), and the middle is a bit different.

FWIW I don’t think “Total” is useful – for example, take Starlark … The more salient things about Starlark are that it is restricted to evaluate very fast in parallel, and it has no I/O to the external world. IMO it has nothing to do with Turing completeness.

Related threads on the “total” issue:

https://lobste.rs/s/dyqczr/find_mkdir_is_turing_complete

https://lobste.rs/s/gcfdnn/why_dhall_advertises_absence_turi...

bob1029 4/12/2025||
I think SQL is one of the best level 4/5 configuration languages out there. Whether or not it's a "full programming language" depends on your specific dialect and how it's used.
danpalmer 4/13/2025|
Only if what you specifically want is to represent queries. If what you want to represent is roughly static data then SQL is an incredibly awkward language to use.
bob1029 4/13/2025||
This is valid SQL:

  SELECT 'Constant'
danpalmer 4/14/2025||
Sure, but try creating a list of maps with string keys and values that can be ints, strings, lists, or maps, or protos for that matter.

I've recently been writing quite a lot of unit tests for SQL, and the biggest pain point is setting up the state of your data, because SQL is just not an ergonomic language in which to do that. Mostly I've just ended up writing YAML describing the rows I want in a database (and I use proto fields in DBs so some nesting there), and using a utility that converts that can load that YAML as a table.

ks2048 4/13/2025||
> I actually like XML. It isn't "cool" like YAML anymore, but it has better tooling support (e.g. schema checking) and doesn't try to be too clever. Just try to stay away from namespaces and don't be afraid of using attributes.

I agree with this (even though, In practice I usually just use JSON or YAML) - it avoids some of the pitfalls of both JSON and YAML - has comments, lacks ambiguity. The main annoyances are textContent (is whitespace important?), attributes vs children, verbosity of closing tags, etc.

retropragma 4/13/2025|
Every time I work with XML data, I hate it. Just use JSONC imo.
throw0101d 4/12/2025||
Personally I lean towards what ISC BIND uses:

* https://bind9.readthedocs.io/en/latest/reference.html#option...

* https://www.zytrax.com/books/dns/ch7/statements.html

Not as 'freestyle' as INI (Level 2), but a little less structured than most of the Level 3 stuff.

retropragma 4/13/2025||
As a TypeScript developer, my answer is to use unconfig [1]. Support for JSON, JavaScript, or best of all, TypeScript.

Or wire up your own utility function with bundle-require [2], another favorite of mine, for loading TS or JS config files.

[1]: https://github.com/antfu-collective/unconfig [2]: https://github.com/egoist/bundle-require

rdtsc 4/12/2025||
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.

ks2048 4/13/2025||
I'm not sure "total" vs "turing-complete" should be a huge difference - just terminate with an error after X seconds.

For example, can "total programming languages" include: "for i in range(10000000000000): do_something()"?

If so, your config file can still hang - even though it provably terminates.

lmm 4/13/2025|
It's a lot easier to accidentally make a file that takes forever than to accidentally make a file that takes a long but finite amount of time.
kristopolous 4/12/2025||
The distance between 3 and 4 are wider and have more members. Take CSS for example.
qznc 4/12/2025|
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...
kristopolous 4/12/2025||
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.

hmry 4/12/2025||
Level 4 / total programming languages are not turing complete. Because you can't simulate every turing machine in them, only some subset that provably halts. (And because the halting problem is undecidable, there will always be some turing machines that actually do halt but still can't be simulated because the compiler can't prove it)
kristopolous 4/13/2025||
It's been edited since I wrote this and it's now 5 instead of 4

It didn't originally use the obscure formal idea of a "total" language

nxnxdndndn 4/13/2025||
How is a total language obscure? It's a language describing total functions
kristopolous 4/13/2025||
oh I knew I was going to get this. Now I have to define obscure. Let's go!

Github has two (yes, just 2) repositories referring to them: (that's nearly 0.000 000 5% of Github I hear you say)

https://github.com/search?q=%22total%20language%22&type=repo...

But maybe that's unfair. Let's try a software engineering encyclopedia!

Ok, "Encyclopedia of Software Engineering (2011)" doesn't have it: https://archive.org/details/encyclopediaofso0001unse_m2w7/pa...

Alright what about programming language text book?

Well, "Programming language design concepts" (2004) also doesn't mention it https://archive.org/details/programminglangu0000watt/mode/2u...

What about Donald Knuth? Surely! Nope, not on the versions of his text on archive.org at least.

https://archive.org/details/artofcomputerpro0002knut_u2o0/mo... also https://archive.org/details/artofcomputerpro0000unse_e7w6/mo...

Oh let's go to arxiv. I'm sure of the ~400 CS papers that go up daily there'd be hundreds of ... oh wait, we got 5 spreading over 17 years: https://arxiv.org/search/?query=%22total+language%22&searcht... about 1 every 3 years. Alright.

And thus with 5 different sampling methods all supporting the same conclusion I will support the claim that it is obscure.

I know how on the internet, vibes tends to win over cited defensible evidence but I did it anyway. Maybe we can be all be adults some day.

iambvk 4/13/2025|
IMO there is another level in between 3 and 4 where config file allows for cross referencing among config values, forming a graph.

   foo.password = xxx
   bar.password = yyy
   wifi.ssid = foo
More comments...