sympa
sympa copied to clipboard
Improve format of configurations
Expected Behavior
The format of the configuration file(s) should be as uniform, flexible, and generic as possible.
Current Behavior
- Each part of the configuration is divided into various configuration files, data source definitions, XML file for list creation, dump files and so on.
- Each of the configuration uses a (generally different) hand-made format on an ad hoc basis. (For example, common parameters are written in different formats for individual list settings and for domain or site-wide settings.) Hand-made formats increase the cost of maintenance.
- Sometimes the format is not expressive enough to describe the settings. Example: scenario files, task files.
Possible Solution
I propose that we move to a format that is as uniform and generic as possible.
Here are some candidates along with their pros / cons:
\ | JSON | Lua | TOML | UCL | YAML | Comments |
---|---|---|---|---|---|---|
Human-easily-readable | Less | Less | More | More | More | |
Strict grammer | Strict | Strict | Strict | Tolerant | Tolerant | Whether a partial error invalidates the whole or not. |
Comment syntax | No | Yes | Yes | Yes | Yes | Grammatical elements for notes that do not make sense as data. |
Inclusion syntax | No | Yes | No | Yes | No | Grammatical elements to include data fragments from other files. |
Scripting capability | No | Yes | No | No | No | Runtime control including conditional branching. |
(Upper-)compatible to JSON | - | No | No | Yes | Yes(*) | (*) YAML: Some implementations, e.g. YAML-Tiny, are not compatible. |
Unity of specification in actual implementations | High | High | High | High | A bit diverse | |
Implementations for Perl | JSON, JSON-XS | Lua-API | TOML-Tiny, TOML-XS | Config-UCL | YAML, YAML-PP, YAML-PP-LibYAML, YAML-Safe, YAML-Syck, YAML-Tiny, YAML-LibYAML |
Lua is not a configuration file in the usual sense, but it would be useful for migrating scenarios and tasks definitions. For the other configuration files, we could choose from the remaining four.
Planned tasks
TBD.
Related issues
- #17
- #1157