Discussion about Cancel-Lock support
Julien ÉLIE
julien at trigofacile.com
Mon Oct 4 19:00:56 UTC 2021
Hi Russ, hi all,
> One of my past regrets was when I was looking at configuration file
> formats, I probably shouldn't have hand-rolled a parser and instead
> figured out how to use YAML. In my defense, at the time it was far from
> obvious that YAML would win the configuration language wars (and I guess
> it hasn't entirely won them even now), and there were a lot of other
> possibilities. But now I kind of wish all the INN configuration files
> were just in YAML. The popularity of Kubernetes among other things has
> made YAML fairly universal, with great editor, linting, and schema
> support. Ah well. Maybe a project for some future day when someone is
> feeling wildly ambitious. :)
>
> (And yes, I know YAML is hideously, absurdly complicated and there are a
> lot of language features you probably don't want to use. But it's still
> the most readable and writable configuration language for humans IMO, even
> with its strange quirks and aggressive interpretation of words as
> booleans.)
It may be the right moment to do the most appropriate thing as for
configuration files.
We currently have only 1 file (inn.conf) that uses the internal new
parser. All the other files have various different parsers.
For the new secrets.conf file, we can:
- either directly use YAML for it, and then plan on migrating other
configuration files to YAML, including inn.conf;
- or make the parser generic for several files, and then re-use it for
new config files. It normally suits our needs.
As far as I see, inn.conf has already a YAML-like syntax except for
vectors. We still haven't used group tags, and I doubt people use
several parameters in the same line separated with semicolons.
Therefore switching it to YAML should not be too much difficult unless
of course we do at the same time a deeper refactoring and urbanization
of all the configuration variables present in inn.conf, and that's more
challenging.
The drawbacks I would see for YAML is that we add a library dependency
to libyaml, hoping it is available in all the platforms we support
(libyaml seems more wide-spread than libfyaml). And naturally that it
would make the current inn.conf parser useless after migrated to YAML.
Which is a loss of a great deal of hard work. And personally I like its
way to write lists ([a b c]) more than YAML does (multi-lines).
--
Julien ÉLIE
« Roma tibi subito motibus ibit amor. »
More information about the inn-workers
mailing list