Re: [crossfire] File format

2022-01-13 Thread Kevin Zheng

On 1/12/22 7:42 PM, Steven Johnson wrote:

I was curious how each format would look when using actual crossfire data.
So, I made this webpage to show it! 
https://shjohnson314.com/cf/format-compare/ 



I show the following side-by-side: Current, YAML, XML, JSON, TOML
using an example of formulae descriptions.


Thank you, Steve, for putting this together.

I think your arguments preferring YAML or XML over JSON are compelling.

I'm not very familiar with the parser libraries that are available for 
YAML or XML parsing. I would find it useful if someone could comment on 
choices for C or C++ and Java YAML and XML parsers.


(Java, because Gridarta is written in Java.)

Is there an analog to XSD validation for YAML?

Regards,
Kevin
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire
IRC: http://crossfire.real-time.com/irc/index.html
Discord: http://crossfire.real-time.com/discord/index.html
Project Site: https://sourceforge.net/projects/crossfire/
Wiki: http://wiki.cross-fire.org/
Website: http://crossfire.real-time.com


Re: [crossfire] File format

2022-01-12 Thread Steven Johnson
I was curious how each format would look when using actual crossfire data.
So, I made this webpage to show it!
https://shjohnson314.com/cf/format-compare/

I show the following side-by-side: Current, YAML, XML, JSON, TOML
using an example of formulae descriptions.

I also included pros and cons for each (as objective as possible).

If most people don't mind the whitespace dependency, then I most prefer
YAML, otherwise XML.

When creating the examples, I noticed the following problems with JSON:
- Does not allow comments (as I said above, though Nicolas suggested
including them as part of our data)
In the example I show "data-comments" for the whole file and individual
items.
I also include regular comments that don't belong to a particular object
(except in JSON).
- Does not allow multiline strings
This is what makes me dislike JSON for this use case. We can't include
comments or
"data-comments" that are more than one line (easily/nicely).
Anything else that is more than one line (messages, books) would look bad
too in JSON.

Because of these problems with JSON, my next favorite would be XML.

I included TOML only because it came up in comparisons between different
file formats. It's simple but I
couldn't get formula ingredients nicely formatted. TOML does not allow
arrays with different types.

If I got some pros or cons wrong please let me know.

Steven H Johnson

On Tue, Dec 21, 2021 at 12:08 PM Nicolas Weeger 
wrote:

> Hello.
>
>
> > Since XML is a subset (superset?) of SGML, I think finding and
> > incorporating an XML parser is much easier than a SGML one.
>
> Probably, yes.
>
> > I think the biggest tug of war would be between JSON and XML. I would
> > likely lean toward JSON, since it's more compact.
>
> Both are good enough in my eyes, so I guess it'll depend on who actually
> writes the first code :)
>
>
> > I think it's important that editing tools are more or less ironclad
> > before making a big change. As hard as it is to learn to make and
> > submit new/changed content, I'd hate to see it get more intimidating
> > through adoption of new formats.
>
> Well, some people find modifying text files intimidating, I guess... Yes
> tools
> should be as ironclad as possible, but bugs happen... Besides, a good text
> editor nowadays will handle JSON or XML without too much hassle, so
> changing
> manually would still be possible.
>
>
> > Overall, I'll be sad to see a departure from the current flat files,
> > though I acknowledge that the need for something more "standard" is
> > legitimate.
>
> Well, you can always write a parser generator :)
>
> Given the flat text format definition (in what language?), a generator
> that'll
> write a parser (and writer) for it.
>
> Then we can keep the flat files :D
>
>
> Best regards
>
>
> Nicolas___
> crossfire mailing list
> crossfire@metalforge.org
> http://mailman.metalforge.org/mailman/listinfo/crossfire
> IRC: http://crossfire.real-time.com/irc/index.html
> Discord: http://crossfire.real-time.com/discord/index.html
> Project Site: https://sourceforge.net/projects/crossfire/
> Wiki: http://wiki.cross-fire.org/
> Website: http://crossfire.real-time.com
>
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire
IRC: http://crossfire.real-time.com/irc/index.html
Discord: http://crossfire.real-time.com/discord/index.html
Project Site: https://sourceforge.net/projects/crossfire/
Wiki: http://wiki.cross-fire.org/
Website: http://crossfire.real-time.com


Re: [crossfire] File format

2021-12-16 Thread Nathaniel Kipps
A few points, hopefully helpful, maybe flaming:

> SGML

Since XML is a subset (superset?) of SGML, I think finding and
incorporating an XML parser is much easier than a SGML one.

> YAML

I hate the idea of being whitespace dependent. Although, I haven't
actually *used* YAML...

I think the biggest tug of war would be between JSON and XML. I would
likely lean toward JSON, since it's more compact.

> Hopefully though the files will ultimately be manipulated through tools and 
> not
> edited directly... ^.^;;;

I think it's important that editing tools are more or less ironclad
before making a big change. As hard as it is to learn to make and
submit new/changed content, I'd hate to see it get more intimidating
through adoption of new formats.

Overall, I'll be sad to see a departure from the current flat files,
though I acknowledge that the need for something more "standard" is
legitimate.

--DraugTheWhopper
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire
IRC: http://crossfire.real-time.com/irc/index.html
Discord: http://crossfire.real-time.com/discord/index.html
Project Site: https://sourceforge.net/projects/crossfire/
Wiki: http://wiki.cross-fire.org/
Website: http://crossfire.real-time.com


Re: [crossfire] File format

2021-12-08 Thread Ruben Safir
when your a hammer everything looks like a nail

SGML has been doing the job for 30 years+ is my memory serves me right



On Wed, Dec 08, 2021 at 02:14:30PM -0500, Steven Johnson wrote:
> That sounds like a good idea to me.
> 
> I suggest YAML since it looks nice and allows comments.
> 
> XML is pretty verbose but handles anything.
> 
> JSON looks better than XML but technically doesn't allow comments.
> 
> I don't think INI files would support what crossfire needs.
> 
> On Wed, Dec 8, 2021, 1:41 PM Nicolas Weeger 
> wrote:
> 
> > Hello.
> >
> > I'm wondering about replacing (some of) our home-made file formats by some
> > standard - json, xml, yaml, whatever, ideas welcome.
> >
> > My rationale is that it's a pain to change the parsing code each time we
> > want
> > to add something to an existing file.
> >
> >
> > Opinions? Flames? Blessings?
> >
> >
> > Best regards
> >
> >
> > Nicolas___
> > crossfire mailing list
> > crossfire@metalforge.org
> > http://mailman.metalforge.org/mailman/listinfo/crossfire
> > IRC: http://crossfire.real-time.com/irc/index.html
> > Discord: http://crossfire.real-time.com/discord/index.html
> > Project Site: https://sourceforge.net/projects/crossfire/
> > Wiki: http://wiki.cross-fire.org/
> > Website: http://crossfire.real-time.com
> >

> ___
> crossfire mailing list
> crossfire@metalforge.org
> http://mailman.metalforge.org/mailman/listinfo/crossfire
> IRC: http://crossfire.real-time.com/irc/index.html
> Discord: http://crossfire.real-time.com/discord/index.html
> Project Site: https://sourceforge.net/projects/crossfire/
> Wiki: http://wiki.cross-fire.org/
> Website: http://crossfire.real-time.com


-- 
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com 

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive 
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com 

Being so tracked is for FARM ANIMALS and extermination camps, 
but incompatible with living as a free human being. -RI Safir 2013

___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire
IRC: http://crossfire.real-time.com/irc/index.html
Discord: http://crossfire.real-time.com/discord/index.html
Project Site: https://sourceforge.net/projects/crossfire/
Wiki: http://wiki.cross-fire.org/
Website: http://crossfire.real-time.com


Re: [crossfire] File format

2021-12-08 Thread Rick Tanner


I can see and agree with your rationale for choosing a standard file 
format vs the home-made options.


But, as far as which one(s) and why - I have only worked with YAML. So I 
will have to defer to others for more discussion on the pros and cons of 
the file formats.

___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire
IRC: http://crossfire.real-time.com/irc/index.html
Discord: http://crossfire.real-time.com/discord/index.html
Project Site: https://sourceforge.net/projects/crossfire/
Wiki: http://wiki.cross-fire.org/
Website: http://crossfire.real-time.com


Re: [crossfire] File format

2021-12-08 Thread Steven Johnson
That sounds like a good idea to me.

I suggest YAML since it looks nice and allows comments.

XML is pretty verbose but handles anything.

JSON looks better than XML but technically doesn't allow comments.

I don't think INI files would support what crossfire needs.

On Wed, Dec 8, 2021, 1:41 PM Nicolas Weeger 
wrote:

> Hello.
>
> I'm wondering about replacing (some of) our home-made file formats by some
> standard - json, xml, yaml, whatever, ideas welcome.
>
> My rationale is that it's a pain to change the parsing code each time we
> want
> to add something to an existing file.
>
>
> Opinions? Flames? Blessings?
>
>
> Best regards
>
>
> Nicolas___
> crossfire mailing list
> crossfire@metalforge.org
> http://mailman.metalforge.org/mailman/listinfo/crossfire
> IRC: http://crossfire.real-time.com/irc/index.html
> Discord: http://crossfire.real-time.com/discord/index.html
> Project Site: https://sourceforge.net/projects/crossfire/
> Wiki: http://wiki.cross-fire.org/
> Website: http://crossfire.real-time.com
>
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire
IRC: http://crossfire.real-time.com/irc/index.html
Discord: http://crossfire.real-time.com/discord/index.html
Project Site: https://sourceforge.net/projects/crossfire/
Wiki: http://wiki.cross-fire.org/
Website: http://crossfire.real-time.com