|
On 2013-01-05 10:55 AM, "Duncan Cross" <duncan.cross@gmail.com> wrote:
>
> On Sat, Jan 5, 2013 at 2:31 PM, steve donovan <steve.j.donovan@gmail.com> wrote:
> > On Sat, Jan 5, 2013 at 12:03 PM, Marc Balmer <marc@msys.ch> wrote:
> >> One statement by a colleague is: "Now for the data transfer representation, as in D.'s proposal, JSON is an option, but LUA is not, simply because we have no (and there can not be any) small C binding to it."
> >
> > I have some sympathy with this, if one isn't already doing something
> > non-trivial with Lua. JSON is nice and stupid, although personally I
> > find Lua data easier to read.
>
> For readability, my least favourite things about canonical JSON are
> that it does not support comments, and there's no way to break a long
> string literal over multiple lines. Apart from that it's pretty good.
>
> -Duncan
>
I think not supporting comments should be reason enough to disqualify it as a format for config files, especially for kernel stuff. Of course, removing comment-only lines is fairly trivial preprocessing...
JSON is really designed for machine intercommunication, with the bonus that it *can* be read and written by humans if necessary (eg for testing and debugging). It's not really intended to be used for things that users need to read and modify.
Lua may be a bit heavy if all you need is a simple config file, but I might try to convince you that you should go beyond that and make your app fully scriptable. ;)