From: Ian Jackson Subject: Re: [PATCH V4] libxl, Introduce a QMP client Date: Mon, 20 Jun 2011 16:37:16 +0100 Message-ID: <19967.26924.105331.354302@mariner.uk.xensource.com> References: <1308324754-19159-1-git-send-email-anthony.perard@citrix.com> <19967.24103.640384.969388@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <19967.24103.640384.969388@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: anthony.perard@citrix.com, Xen Devel , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org I wrote: > Oh wait, I just looked up yajl. Why are we using a SAX-style > (callback-based) json parser ? > > Surely it would be better to use a json library which simply provides > an in-memory data structure for each json object. We don't anticipate > dealing with any huge json objects (which is the motivation for the > SAX-style approach). Well, I went and did some searching and I have discovered that: There does not appear to be any widely-used "atomic-style" json library for C, other than the one which comes with glib (which is unsuitable because we don't want to import glib into our project). YAJL 2 does have a simple "atomic" ("tree" they call it) interface. It's not in squeeze or afaict recent fedora. YAJL 1 is even lacking in Debian lenny. :-/. So probably what we have is the best approach. But perhaps it might be worth considering whether we should make our interface to json objects the similar to yajl 1's tree interface ? Ian.