<div dir="ltr"><div>I was curious how each format would look when using actual crossfire data.</div><div>So, I made this webpage to show it! <a href="https://shjohnson314.com/cf/format-compare/">https://shjohnson314.com/cf/format-compare/</a></div><div><br></div><div>I show the following side-by-side: Current, YAML, XML, JSON, TOML</div><div>using an example of formulae descriptions.<br></div><div><br></div><div>I also included pros and cons for each (as objective as possible).</div><div><br></div><div>If most people don't mind the whitespace dependency, then I most prefer YAML, otherwise XML.</div><div><br></div><div>When creating the examples, I noticed the following problems with JSON:</div><div>- Does not allow comments (as I said above, though Nicolas suggested including them as part of our data)</div><div style="margin-left:40px">In the example I show "data-comments" for the whole file and individual items.</div><div style="margin-left:40px">I also include regular comments that don't belong to a particular object (except in JSON).<br></div><div>- Does not allow multiline strings</div><div style="margin-left:40px">This is what makes me dislike JSON for this use case. We can't include comments or</div><div style="margin-left:40px">"data-comments" that are more than one line (easily/nicely).</div><div style="margin-left:40px">Anything else that is more than one line (messages, books) would look bad too in JSON.<br></div><div style="margin-left:40px"><br></div>Because of these problems with JSON, my next favorite would be XML.<br><div><div><br><div><div>I included TOML only because it came up in comparisons between different file formats. It's simple but I</div><div>couldn't get formula ingredients nicely formatted. TOML does not allow arrays with different types.</div><div><br></div><div>If I got some pros or cons wrong please let me know.</div><div><br></div><div>Steven H Johnson<br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 21, 2021 at 12:08 PM Nicolas Weeger <<a href="mailto:nicolas.weeger@laposte.net">nicolas.weeger@laposte.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello.<br>
<br>
<br>
> Since XML is a subset (superset?) of SGML, I think finding and<br>
> incorporating an XML parser is much easier than a SGML one.<br>
<br>
Probably, yes.<br>
<br>
> I think the biggest tug of war would be between JSON and XML. I would<br>
> likely lean toward JSON, since it's more compact.<br>
<br>
Both are good enough in my eyes, so I guess it'll depend on who actually <br>
writes the first code :)<br>
<br>
<br>
> I think it's important that editing tools are more or less ironclad<br>
> before making a big change. As hard as it is to learn to make and<br>
> submit new/changed content, I'd hate to see it get more intimidating<br>
> through adoption of new formats.<br>
<br>
Well, some people find modifying text files intimidating, I guess... Yes tools <br>
should be as ironclad as possible, but bugs happen... Besides, a good text <br>
editor nowadays will handle JSON or XML without too much hassle, so changing <br>
manually would still be possible.<br>
<br>
<br>
> Overall, I'll be sad to see a departure from the current flat files,<br>
> though I acknowledge that the need for something more "standard" is<br>
> legitimate.<br>
<br>
Well, you can always write a parser generator :)<br>
<br>
Given the flat text format definition (in what language?), a generator that'll <br>
write a parser (and writer) for it.<br>
<br>
Then we can keep the flat files :D<br>
<br>
<br>
Best regards<br>
<br>
<br>
Nicolas_______________________________________________<br>
crossfire mailing list<br>
<a href="mailto:crossfire@metalforge.org" target="_blank">crossfire@metalforge.org</a><br>
<a href="http://mailman.metalforge.org/mailman/listinfo/crossfire" rel="noreferrer" target="_blank">http://mailman.metalforge.org/mailman/listinfo/crossfire</a><br>
IRC: <a href="http://crossfire.real-time.com/irc/index.html" rel="noreferrer" target="_blank">http://crossfire.real-time.com/irc/index.html</a><br>
Discord: <a href="http://crossfire.real-time.com/discord/index.html" rel="noreferrer" target="_blank">http://crossfire.real-time.com/discord/index.html</a><br>
Project Site: <a href="https://sourceforge.net/projects/crossfire/" rel="noreferrer" target="_blank">https://sourceforge.net/projects/crossfire/</a><br>
Wiki: <a href="http://wiki.cross-fire.org/" rel="noreferrer" target="_blank">http://wiki.cross-fire.org/</a><br>
Website: <a href="http://crossfire.real-time.com" rel="noreferrer" target="_blank">http://crossfire.real-time.com</a><br>
</blockquote></div>