-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I personally hate XML.   It's crazy to reject SGF because of it's
readability only to use XML which is verbose and only somewhat readable
if you carefully construct it to be.    What is crazy to me is that it
was desgined to be HUMAN readable,  and yet the argument to use it is
that there are lots of libraries to create it and parse it.   It's
almost impossible to write XML manually without bugs.   As far as I'm
concerned you might as well use a much more efficient binary format if
it's designed to be used with libraries for reading and writing.

Just my opinion,  don't want to start any wars here ... :-)

Web pages that send xmlHttpRequests to a server are moving away from XML
to the more readable and much more easily parsable JSON.      The main
advantage of JSON in my opinon is that it is a subset of the far more
sane YAML   Of course YAML and XML are not direct replacements for each
other.   They both have strengths and weaknesses.  YAML is a data
serialization language - you could describe a GO game in it, and
basically have the data structure to describe this game to whatever
language you write in.   JSON looks like javascript data declarations
and you can just directly eval it.

XML has the advantage that it's an industry standard.    So is JSON
(which is YAML)  but less so.    YAML has the advantage that it's much
easier to parse - software runs much faster if it's doing signficant
parsing in YAML vs XML.

I looked at the web site and it says near the top:  "XML is far more
human readable than SGF"

I looked at the example XML game and it was horrific to read and
incredibly verbose:

<?xml version="1.0" encoding="utf-8"?>
<Go>
<GoGame>
<Information>
<BoardSize>19</BoardSize>
</Information>
<Comment>A test game</Comment>
<Black at="Q16"/>
<White at="Q4"/>
<Black at="D4"/>
<White at="D16"/>
<Black at="F17"/>
<White at="C14"/>
<Black at="D18"/>
<White at="C17"/>
<Black at="J17"/>
</GoGame>
</Go>


I'm not suggesting that we use JSON,  it has the same drawbacks as XML.
  Just my opinon,  but if you were to suggest an alternative format the
EASIEST to read and very easy to parse is PGN - yes, I know, the same
format chess games are in.

PGN is designed specifically to be easy to read.  There is huge
difference between being "human readable" and "easy to read" and pgn is
definitely easiest of all formats to read.

Here is an example:

[Event "Autotest Sequence"]
[Site "Local Site"]
[Date "2007.02.08"]
[Round "4"]
[Black "bas"]
[BlackTime "00:01:59"]
[White "mog"]
[WhiteTime "00:05:44"]
[Boardsize "9x9"]
[Komi "7.5"]
[Rules "Tromp/Taylor"]
[Final "41-40"]
[Result "0-1"]

1. e5 f7 2. d4 g6 3. c5 g4 4. c7 f3 5. e3 f2
6. f5 g5 7. e2 e8 8. d8 d7 9. c8 e1 10. d6 g8
11. d1 f1 12. f4 d2 13. g3 g2 14. h3 h2 15. c2 c1
16. d3 j3 17. h4 h5 18. j2 j4 19. f9 e9 20. e7 d1
21. f8 g9 22. f6 a3 23. d9 f8 24. h7 g7 25. c3 b7
26. h3 j1 27. h1 g1 28. j8 j6 29. h6 h8 30. h4 b6
31. j7 c4 32. j5 j2 33. j6 h9 34. b2 a8 35. b9 b1
36. a4 b4 37. b8 j9 38. j5 j7 39. h6 g3 40. a9 a7
41. a5 b3 42. a1 a6 43. b5 h4 44. a2 c4 45. j6 h7
46. a3 j5 47. b4 h6 48. c6 b7 49. a7 b6 50. a8 pass
51. a6 b7 52. b6 pass 53. pass


You can include tree information by using parenthesis to denote
alternative lines.   There are also provisions for comments and other
such things.

I know PGN doesn't address the issues mentioned in the article which is
to have a "common format for all applications."     If that is
incredibly important,  a better choice is the YAML format.   YAML
parsers exist for every major programming language,  it's more efficient
to process, it's more readable and much less verbose.   Yaml parses
directly into the data structure you are using in your language, so you
are ready to go.

Having said that and despite the fact that I would prefer YAML (or JSON)
over XML,   I don't like it for the same reasons I don't like XML, it's
not a NATURAL format for human consumption.

I think it comes down to how important this is.   If you care very
little about readability and efficiency, use XML, it's a standard and
many libraries exist.   If you want readability,  use PGN or SGF but
with standard algebraic notation (it was a silly mistake not doing this
from the start with SGF.)   If you want a "common format for all your
applications" use YAML which is superior to XML in readability,
efficiency and simplicity.

Interesting web site:

   http://www.xml.com/lpt/a/2002/07/24/yaml.html

Starts out like this:

XML combines all the inefficiency of text-based formats with most of the
unreadability of binary formats. -- Oren Tirosh, comp.lang.python

For a GO format, I would personally stick with the JSON subset of YAML,
it's dirt simple, you can make your own parser in a few minutes and it's
heavily used now with web sites and AJAX.  WAY more sane than XML.

- - Don



Jason House wrote:
> An XML alternative [1] to SGF has recently come to my attention.  What
> do others think of this alternative?  Personally, the effect of a tag
> affecting the previous tag seems kind of strange to me.
> 
> PS: I found out about this from [2], a recently closed GoGui feature
> request to write more sane sgf files that contain the standard algebraic
> notation used in all GUIs.
> 
> [1] http://www.rene-grothmann.de/jago/Documentation/xml.html
> [2]
> https://sourceforge.net/tracker/?func=detail&atid=489967&aid=1752711&group_id=59117
> <https://sourceforge.net/tracker/?func=detail&atid=489967&aid=1752711&group_id=59117>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> computer-go mailing list
> computer-go@computer-go.org
> http://www.computer-go.org/mailman/listinfo/computer-go/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHHMyYDsOllbwnSikRAlzCAJ9GdAETZsLgChGqLvYP5I582ym5iQCgwjx4
JR0TcGEW68zwS7EyOwP78jg=
=niel
-----END PGP SIGNATURE-----
_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to