The 5 levels of configuration languages
Published on: 2025-04-30 18:00:12
Code is data and data is code. Years ago, I had a brief affair with Lisp and there I picked up this meme. Today, I believe there are also benefits in separating code and data.
Glimpses of this debate come up whenever people discuss the syntax for yet another configuration schema. There are 5 levels of power for configuration languages. If you design a new schema, be aware of all of them.
Level 1: String in a File
The file system is a key-value store. The Linux kernel does it with procfs and sysfs. Example from my shell:
$ cat /proc/sys/kernel/arch x86_64 $ cat /proc/sys/kernel/sched_energy_aware 1
I could write 0 to the second one to change the kernel behavior.
This certainly is the simplest format, yet it works.
Level 2: A List
For a little bit more expressive power, you can treat the file contents as a list. Maybe one per line. Maybe a key-plus-value per line. Maybe with sections like an INI file. Example file contents:
[database] server = 192.0.2.62 port = 143 file = "payro
... Read full article.