Date: Wed, 30 Jul 2014 11:48:59 -0700 From: Jos Backus <jos@catnook.com> To: Baptiste Daroussin <bapt@freebsd.org> Cc: arch@freebsd.org, Adrian Chadd <adrian@freebsd.org>, Jordan Hubbard <jkh@mail.turbofuzz.com>, "Simon J. Gerraty" <sjg@juniper.net> Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML Message-ID: <CAETOPp0kj1pE1nGGX8iLm0jZX8wL_-=SQANU1Jmznp2riv5cXA@mail.gmail.com> In-Reply-To: <20140730170355.GM37672@ivaldir.etoilebsd.net> References: <A1E63A7A-BB38-4CC3-B5EC-B251BE990572@mail.turbofuzz.com> <CAETOPp0c1xfMj1vDvQRSoV3ec-LdJmyT9AFH02iziN0yuY1D-A@mail.gmail.com> <CAJ-VmomiwUWHWYLdLcQAnp7QBmvQR2wfPoCy=eie-jrvyw0HfA@mail.gmail.com> <CAETOPp3zkpp4PY-CeA4Ei=r7_tw1S6rVYiniU%2BZxQF3PESVAxA@mail.gmail.com> <20140729232338.40AA6580A2@chaos.jnpr.net> <CAETOPp1xcNZW1YdgVErZ2ngJM5D3p%2BL3HJHE2aKOvEvSh6Sh%2Bw@mail.gmail.com> <20140730034641.46ABE580A2@chaos.jnpr.net> <CAETOPp2_dwqeLwYOatS-SrP5FYYYJA%2BGCK2qUsCVTyX4MJ7Yeg@mail.gmail.com> <20140730071500.GF37672@ivaldir.etoilebsd.net> <CAETOPp3wedFRmDTTX4kfm-AoyB2bk-pUEOfO5WSM8M_i186Hyw@mail.gmail.com> <20140730170355.GM37672@ivaldir.etoilebsd.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Jul 30, 2014 10:04 AM, "Baptiste Daroussin" <bapt@freebsd.org> wrote: > > On Wed, Jul 30, 2014 at 09:18:40AM -0700, Jos Backus wrote: > > On Jul 30, 2014 12:15 AM, "Baptiste Daroussin" <bapt@freebsd.org> wrote: > > > > > > On Tue, Jul 29, 2014 at 09:44:17PM -0700, Jos Backus wrote: > > > > On Jul 29, 2014 8:46 PM, "Simon J. Gerraty" <sjg@juniper.net> wrote: > > > > > > > > > > > > > > > On Tue, 29 Jul 2014 16:30:53 -0700, Jos Backus writes: > > > > > >> You certainly cannot wait for all of it to arrive before you start > > > > > >> rendering. > > > > > > > > > > > >Understood. This is why a serialization output format that supports > > > > > >streaming data is useful. > > > > > > > > > > Indeed; XML works fine for that. > > > > > > > > Not to beat a dead horse, but so does YAML, and it's more > > lightweight/less > > > > verbose so I personally find it more elegant. But sure, XML would work > > as > > > > well. > > > > > > > YAML is not more lightweight at all, it is really heavy to parse compared > > to > > > XML or JSON. > > > > By lightweight I meant syntax verbosity, not computational load (although > > it seems easy to emit). It's a more flexible format, and that comes with a > > certain price. The question is whether that flexibility is needed or > > useful. If JSON can't be used because of its limitations, I would > > personally prefer the less verbose YAML over XML. > > > About json what limitation are you talking about? Several limitations have been mentioned: no support for comments, binary data, streaming. YAML is a superset of JSON so there are things one can do with YAML that one cannot do (easily) with JSON. The question is whether those things matter enough. > In yaml you have 2 syntax, on which is inconsistent but user friendly and the > other which as ugly as XML imho > > this_is_string: treu > this__bool: true > so_if_i_want_a_string_true_i_need_quote: "true" > > If I want to be consistent I need to use the canonical form of yaml: > > --- > !!map { > ? !!str "so_if_i_want_a_string_true_i_need_quote" > : !!str "true", > ? !!str "this__bool" > : !!bool "true", > ? !!str "this_is_string" > : !!str "treu", > } > > and now this is very very ugly :( Cute, but rare. How often can one not use the easy format, and how often does one want the string" true" rather than the Boolean value? > Plus yaml is context dependant and space dependant resulting in people getting lost about: > "Why this yaml is not valid": > > hu: ha > hi: > - test > - test2 > > Or why this one is not valid either? > > hu: ha > hi: test > > > I have been there with pkg(8) after being a huge suppoter of YAML I'm now more moderated :) Sure, one has to apply some care with whitespace. This hasn't prevented Python from becoming popular so it must not be as big a deal, and I know the Ruby community uses YAML effectively quite a bit. > > YAML was not machine friendly at all in the end and very very error prone for humans :( Granted, JSON is a simpler format. Jos P. S. I've said everything I planned to say so I am going to move on from this bikeshed now. > > regards, > Bapt
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAETOPp0kj1pE1nGGX8iLm0jZX8wL_-=SQANU1Jmznp2riv5cXA>