3 ms·
You really don't want to use a Turing-complete language for configuration. It makes all sorts of things impossible such as: - Automatically scanning for insec
by rwmj 14y ago
You really don't want to use a Turing-complete language for configuration. It makes all sorts of things impossible such as:
- Automatically scanning for insecure configurations (eg. OpenSCAP)
- Parsing the configuration in other programs.
- Modifying the configuration programmatically (cf. Puppet et al)
Also, http://augeas.net/ http://augeas.net/
- tikhonj 14y agoThose are the things that would actually get easier: your configuration would be a data structure in the host language rather than a text file. So you wouldn't have to parse it at all. Other programs would have to either be in the same language or have some way of communicating with the host language, but that isn't too bad a restriction. Similarly, this would make modifying configuration programmatically better. Instead of dealing with serializing and deserializing to random text formats, you would just provide a Config -> Config function. This would also make tools modifying configuration parameters more composable because they wouldn't be overwriting each other's changes unnecessarily.
- fizx 14y agoOn the off chance you see this later, I think you want a Turing-complete language, but one without an interesting standard library. > - Automatically scanning for insecure configurations (eg. OpenSCAP) Since the language can't access the outside world, the worst it can do is use unbounded space or time. Just verify that it halts in a couple ms. > - Parsing the configuration in other programs. You don't parse, you embed an interpreter and execute. > - Modifying the configuration programmatically (cf. Puppet et al) Code generation isn't that hard.