[2009/471] OpenSolaris Distribution Constructor - Inception AIs
Shawn Walker
swalker at opensolaris.org
Fri Oct 23 09:52:26 PDT 2009
Sarah Jelinek wrote:
> My biggest concerns about moving to JSON are:
> -No commenting. We absolutely need this for clarity. We do not have any
> tools to generate or modify our manifests, so the comments in our
> current manifests help users understand the contents.
The original JSON specification supported comments, but in later
versions they removed this for the lame reason that "no-one used it" as
best I can tell.
> -Unicode only support.
>
> I don't think that JSON is a viable option for us at this point. As a
> result, my recommendation is to continue using XML.
So despite these disadvantages, there are a few things about JSON (and
this is why we ended up using it for pkg(5)) that are very attractive:
* far more readable to mere mortals than XML, example:
{
"publishers": ["opensolaris.org", "sun.com"],
"packages": ["foo", "bar", "baz"],
}
Imagine the same in XML :) This also significantly can reduce file size.
* almost a one-to-one mapping between python native data types and
serialized output (which meant we could just dump an in-memory python
data structure directy to disk and then read it back without any
transformation; assuming only strings, numbers)
If the Unicode only aspect doesn't bother you, and you can come up with
a basic container format that allows comments, and none of the other
issues are a problem, then the advantages above may be more important to
you.
It isn't an easy choice, and I won't try to persuade you one way or
another. If you're already using XML and everyone's happy, then go for
it :)
Cheers,
--
Shawn Walker
More information about the opensolaris-arc
mailing list