From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOa4r-0002V9-2y for qemu-devel@nongnu.org; Fri, 14 Mar 2014 17:55:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOa4m-0000eL-3R for qemu-devel@nongnu.org; Fri, 14 Mar 2014 17:55:41 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:56188 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOa4l-0000dN-PR for qemu-devel@nongnu.org; Fri, 14 Mar 2014 17:55:36 -0400 Date: Fri, 14 Mar 2014 22:55:34 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140314215534.GC3860@irqsave.net> References: <87eh2mgusw.fsf@blackfin.pond.sub.org> <87d2i3z7l0.fsf@fimbulvetr.bsc.es> <8738izxpyb.fsf@blackfin.pond.sub.org> <5314C244.5070805@redhat.com> <87y50qs85q.fsf@blackfin.pond.sub.org> <20140313153355.GA5294@irqsave.net> <5321D4A7.7000007@redhat.com> <87wqfy2cvb.fsf@fimbulvetr.bsc.es> <20140314163546.GE3324@irqsave.net> <8761ngv88p.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <8761ngv88p.fsf@fimbulvetr.bsc.es> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 2/3] qapi: Add a primitive to include other files from a QAPI schema file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Beno=EEt?= Canet , Eric Blake , Markus Armbruster , qemu-devel@nongnu.org The Friday 14 Mar 2014 =E0 21:24:38 (+0100), Llu=EDs Vilanova wrote : > Beno=EEt Canet writes: >=20 > > The Thursday 13 Mar 2014 =E0 19:05:12 (+0100), Llu=EDs Vilanova wrote= : > >> Eric Blake writes: > >>=20 > >> > On 03/13/2014 09:33 AM, Beno=EEt Canet wrote: > >> >>> We certainly can't do without comments. > >> >>>=20 > >> >>> JSON is designed for easy data exchange, but we use it as progra= mming > >> >>> language syntax. Its restrictions make sense for easy data exch= ange, > >> >>> but hurt our use. We're not the first ones experiencing that pa= in: > >> >>> http://json5.org/ > >> >>>=20 > >> >>> No idea how much momentum this JSON5 thingy has... > >>=20 > >> > If we 's,#,//,', our comments magically fall in line with JSON5 sy= ntax; > >> > everything else in our files is already compliant with JSON5. > >>=20 > >> >>>=20 > >> >>> Switch to JSON5 and call it qapi-schema.json5? > >>=20 > >> > This actually seems like a rather nice idea - but due to our choic= e of > >> > comments, it means rewriting the bulk of the file and tweaking our= parser. > >>=20 > >> >>>=20 > >> >>=20 > >> >> Hmm don't we want something that python and other language know h= ow to parse out > >> >> of the box ? Or will we write yet another delicate work of art to= parse it ? > >>=20 > >> > 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 nam= es 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 origina= l JSON. > >>=20 > >> 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 l= oading 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 hackis= hly > >> "injected" before parsing). > >>=20 > >>=20 > >> Lluis >=20 > > I have an use case for this series. >=20 > > Lluis: Do you plan to respin this series ? Or should I do it ? >=20 > I was waiting for some other series to get merged, since they conflict.= But I > still did not change the "include" syntax. >=20 > 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=EEt >=20 >=20 > Lluis >=20 >=20 > --=20 > "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 Phanto= m > Tollbooth