The MASM Forum

General => The Workshop => Topic started by: Biterider on November 19, 2022, 10:05:12 PM

Title: TOML configuration file
Post by: Biterider on November 19, 2022, 10:05:12 PM
Hi
Toml files have been heavily pushed by Python lately. I took a look at these and they actually have some interesting advantages.  :thumbsup:

Its homepage is https://toml.io/en/ (https://toml.io/en/).

Compared to JSON or XML formats, it looks much simpler while offering the same functionality at the same time.

Some previous discussions can be found here:
http://masm32.com/board/index.php?topic=9081.msg99760#msg99760 (http://masm32.com/board/index.php?topic=9081.msg99760#msg99760)
http://masm32.com/board/index.php?topic=9001.msg98607#msg98607 (http://masm32.com/board/index.php?topic=9001.msg98607#msg98607)

Biterider
Title: Re: TOML configuration file
Post by: HSE on November 19, 2022, 11:11:40 PM
Hi Biterider!

Look easier to write, but harder to track errors, than JSON.

In the balance there is little to gain moving JSON to TOML, I think.

I maked a couple of apps that run in the phone using Java and, for obvious reasons, JSON work very nice.  :biggrin:

Anyway could be interesting to have that in repertory, just in case Python become popular  :biggrin: :biggrin:

HSE
Title: Re: TOML configuration file
Post by: Biterider on November 20, 2022, 01:02:11 AM
Hi HSE
One of the things I desperately miss in JSON files are comments...
For the rest, I'm with you  :biggrin:

Biterider
Title: Re: TOML configuration file
Post by: HSE on November 20, 2022, 01:51:35 AM
One of the things I desperately miss in JSON files are comments...

JSONC could be an option.

Code: [Select]
JSON formatted files are readable to humans but the lack of comments decreases readability. With JSONC, you can use block (/* */) and single line (//) comments to describe the functionality. Microsoft VS Code also uses this format in their configuration files like settings.json, keybindings.json, launch.json, etc.