On Monday, 30 January 2023 at 06:38:46 UTC, Daren Scot Wilson wrote:
So, which package do I use for TOML?

I find these three:

* toml-foolery  (Andrej Petrović)
* toml-d, or toml.d (oglu on github) at ver 0.3.0
* toml, (dlang community on github) at ver 2.0.1

I'm guessing from version numbers that the third one, toml, is officially good for real world use. But I wonder if there are good reasons to use the others.

I would go with the dlang-community one, whenever available.

Also, a low-effort search for TOML in the D world turned up SDLang, where the substring "DLang" has nothing to do with dlang, the common short name for D Language. SDLang looks nice. Should I ditch TOML for it?

I would not recommend it. SDL (Simple Declarative Language) is a language we have support for, but it's rather unknown - TOML will probably be simpler for end users.

I just realized - it's been ages since I've dealt with config files, beyond editing them as an end user. I work on existing software where someone else made the choiced and wrote the code, or it's a small specialized project not needing config. I'm a config caveman!

This is for a small fun personal project with potential show-off value, available on github but too primitive for now to mention. Controlling hardware, needing to store device info to recall for later runs. There are zero compatibility or standards issues to consider. Whatever is simplest to implement and tinker with is the winner.

If I can allow a shameless self plug, and if you are willing to consider YAML:
https://github.com/dlang-community/configy

If you are willing to stick to a "simple" config where you essentially want some values to end up in a struct, and want decent error messages, this is for you.

Reply via email to