Re: [DEP 12] Why chosing YAML.
On Sat, Jan 05, 2013 at 12:00:57AM -0800, Russ Allbery wrote:
> Both YAML and JSON are considerably nicer formats than the RFC822-based
> format of Debian control files: better-specified, more standardized,
> clearer, less ambiguous, easier to understand, and *far* more widely
> implemented in terms of finding a parser (or even a writer) for the format
> in just about any language. (JSON has probably surpassed YAML at this
> point, and is probably what I'd use for anything new, but it has a little
> bit more syntactic noise for humans than YAML does since you have to quote
> strings.)
>
> If we were inventing the Debian infrastructure from scratch today, I'd use
> JSON or YAML for all the control files.
I have no very strong opinion whether to use YAML or JSON. Sometimes
the strict requirement of quoting might have advantages. We have seen
cases where you need to quote a string if it contains a ': ' sequence
which is otherwise used as key-value separator. If you are forced to
quote this source of erroneous syntax could be avoided. On the other
hand a syntax checker can very easily detect problems like this.
> That said, every other structured file in a Debian package (with a few
> minor exceptions like debian/watch) is in the deb822 format. So it's
> basically a question of whether the additional hassle of having to deal
> with two different formats and two different parsers in code that operates
> on Debian packages is worth the benefits of YAML.
If you check out the Wiki for the Reference field you see that it is
defined as a mapping or sequence of mappings. I have no idea how to
express this in deb822 format and I could perfectly think of similar
data to store in debian/upstream of this kind. So I'd regard deb822
simply insufficient for storing what we want to store and so the
question whether to use deb822 for debian/upstream becomes void.
Kind regards
Andreas.
[1] http://wiki.debian.org/UpstreamMetadata
--
http://fam-tille.de
Reply to: