From: "Benoît Canet" <benoit.canet@irqsave.net>
To: "Benoît Canet" <benoit.canet@irqsave.net>,
"Eric Blake" <eblake@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 2/3] qapi: Add a primitive to include other files from a QAPI schema file
Date: Fri, 14 Mar 2014 22:55:34 +0100 [thread overview]
Message-ID: <20140314215534.GC3860@irqsave.net> (raw)
In-Reply-To: <8761ngv88p.fsf@fimbulvetr.bsc.es>
The Friday 14 Mar 2014 à 21:24:38 (+0100), Lluís Vilanova wrote :
> Benoît Canet writes:
>
> > The Thursday 13 Mar 2014 à 19:05:12 (+0100), Lluís Vilanova wrote :
> >> Eric Blake writes:
> >>
> >> > On 03/13/2014 09:33 AM, Benoît Canet wrote:
> >> >>> We certainly can't do without comments.
> >> >>>
> >> >>> JSON is designed for easy data exchange, but we use it as programming
> >> >>> language syntax. Its restrictions make sense for easy data exchange,
> >> >>> but hurt our use. We're not the first ones experiencing that pain:
> >> >>> http://json5.org/
> >> >>>
> >> >>> No idea how much momentum this JSON5 thingy has...
> >>
> >> > If we 's,#,//,', our comments magically fall in line with JSON5 syntax;
> >> > everything else in our files is already compliant with JSON5.
> >>
> >> >>>
> >> >>> Switch to JSON5 and call it qapi-schema.json5?
> >>
> >> > This actually seems like a rather nice idea - but due to our choice of
> >> > comments, it means rewriting the bulk of the file and tweaking our parser.
> >>
> >> >>>
> >> >>
> >> >> Hmm don't we want something that python and other language know how to parse out
> >> >> of the box ? Or will we write yet another delicate work of art to parse it ?
> >>
> >> > Our existing parser would only need to learn a new comment syntax to
> >> > parse the subset of JSON5 that we currently actually use. Parsing FULL
> >> > JSON5 would mean also learning about trailing commas, unquoted names in
> >> > name:value pairs, multiline strings, and alternative numeric
> >> > representations. But a point made on the JSON5 page is that ES5
> >> > JavaScript already parses JSON5, just as it already parses original JSON.
> >>
> >> Another option is to bump QEMU requirements to python 2.6 or later. Then we can
> >> use the json parser that comes with python. A simple pre-processing could
> >> eliminate the comments before passing them to the json package for loading into
> >> python structures. The commands/enums/etc should also be elements of a list for
> >> it to work (that must be either changed on the qapi files, or hackishly
> >> "injected" before parsing).
> >>
> >>
> >> Lluis
>
> > I have an use case for this series.
>
> > Lluis: Do you plan to respin this series ? Or should I do it ?
>
> I was waiting for some other series to get merged, since they conflict. But I
> still did not change the "include" syntax.
>
> I will probably not be able to get to this until May 1st.
Ok, I think I need the include feature more badly than you I will do it.
Best regards
Benoît
>
>
> Lluis
>
>
> --
> "And it's much the same thing with knowledge, for whenever you learn
> something new, the whole world becomes that much richer."
> -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
> Tollbooth
next prev parent reply other threads:[~2014-03-14 21:55 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-28 15:53 [Qemu-devel] [PATCH v4 0/3] qapi: Allow modularization of QAPI schema files Lluís Vilanova
2014-02-28 15:53 ` [Qemu-devel] [PATCH v4 1/3] qapi: Use an explicit input file Lluís Vilanova
2014-03-01 8:35 ` Markus Armbruster
2014-03-03 14:25 ` Lluís Vilanova
2014-03-03 15:42 ` Markus Armbruster
2014-03-03 16:59 ` Lluís Vilanova
2014-03-04 13:17 ` Markus Armbruster
2014-03-05 0:58 ` Lluís Vilanova
2014-02-28 15:53 ` [Qemu-devel] [PATCH v4 2/3] qapi: Add a primitive to include other files from a QAPI schema file Lluís Vilanova
2014-03-01 8:57 ` Markus Armbruster
2014-03-03 14:21 ` Lluís Vilanova
2014-03-03 15:27 ` Markus Armbruster
2014-03-03 17:04 ` Lluís Vilanova
2014-03-03 17:56 ` Eric Blake
2014-03-04 8:02 ` Markus Armbruster
2014-03-13 15:33 ` Benoît Canet
2014-03-13 15:54 ` Eric Blake
2014-03-13 18:05 ` Lluís Vilanova
2014-03-14 16:35 ` Benoît Canet
2014-03-14 20:24 ` Lluís Vilanova
2014-03-14 21:55 ` Benoît Canet [this message]
2014-03-17 14:20 ` Benoît Canet
2014-02-28 15:53 ` [Qemu-devel] [PATCH v4 3/3] qapi: Add tests for the "include" directive Lluís Vilanova
2014-02-28 16:18 ` [Qemu-devel] [PATCH v4 0/3] qapi: Allow modularization of QAPI schema files Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140314215534.GC3860@irqsave.net \
--to=benoit.canet@irqsave.net \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).