For more general data structures, remember that JSON is a true subset of YAML [1]: Switch to a YAML parser and you can start optionally adding comments to your files while still being compatible with legacy input.
[0] https://toml.io/en/ [1] https://yaml.org/
I see a lot of Rust programmers preferring RON over TOML because it is much less complex and doesn't have multiple ways to express the same thing https://crates.io/crates/ron
> For more general data structures, remember that JSON is
> a true subset of YAML [1]
This is unfortunately not true -- try the input '{"a":1e2}'.Do this with libvirt please and report back how it went :)
What I mean with "snapshots" is that you can't edit an XML file for a running VM on disk, but instead have to go through either virt-manager or virsh dump/load function. If you do edit an existing XML file on disk, it will just overwrite it for you.
And XML format is a bit more verbose simply because XML schema writers make it so. SGML could be even nicer for human writers.
As for comments in JSON, many parsers are not strict and would let you insert arbitrary elements, so you might add {"comment":"whatevah"} where you need it.
An example of terse XML would be:
<vm name="postgres">
<ram size="8gb"/>
<disk size="1tb"/>
</vm>or
<vm>
<name>postgred</name>
<ram>8gb</ram>
<disk>1tb</disk>
</vm>compared to JSON:
{
"name": "postgres",
"ram": "8gb",
"disk":"1tb"
}They are not equally descriptive, but that's because you do not need a top-level element in JSON (you could have it).
If you fire up `virsh edit <resource>` you get a live view of the resource which can be updated in place. This is great to comment out some things and uncomment things for quick and dirty modifications. (some require a VM restart though).
var config = require("settings.js");
My reasoning is that if you have access to change config or source code, all bets are off.Or you could parse the config in a separate vm and import the result as JSON.
Hell, even INI files had support for comments and were just as expressional as JSON. I wonder why we regressed in that regard. Was it just because of the success of JavaScript and readily available JSON parsers? Because I'd argue that an INI parser is just as easy to write.