[Bugs] #156 TRIV: Inconsistency in using cjson vs json
SugarLabs Bugs
bugtracker-noreply at sugarlabs.org
Fri Dec 26 00:23:36 EST 2008
#156: Inconsistency in using cjson vs json
-----------------------+----------------------------------------------------
Reporter: nirbheek | Owner: marcopg
Type: defect | Status: new
Priority: trivial | Milestone:
Component: sugar | Version: unspecified
Resolution: | Keywords:
-----------------------+----------------------------------------------------
Comment(by nirbheek):
Replying to [comment:6 garycmartin]:
> This is news to me, could someone actually explicitly state the
requirement here, is it json, or cjson? Or even better post something to
the sugar dev list for activity authors. I'm using json in Moon at the
recommendation of Tomeu (OLPC XO dist has both json and cjson). Thanks.
--G
Here's a roundup of the json-mess in Python:
There's json-py which is installed by default in Ubuntu and Fedora (and
hence by extension in the XO dist). This is a pure-python implementation
of a module for json processing.
There's python-cjson which is a (very fast) C module for json processing,
which is used in sugar, sugar-toolkit, sugar-datastore etc.
There's simple-json which is packaged in Ubuntu and Fedora, but not
installed by default. It is worth mentioning that simple-json was merged
into Python 3k (similar to how part of pyxml and sqlite3 were added to
python 2.6).
The interface for all three are extremely similar:
cjson.decode() == json.read() == simplejson.loads()
cjson.encode() == json.write() == simplejson.dumps()
Now, there are packages which are using these three interchangeably.
I've been [http://gitorious.org/projects/sugar-gentoo/ writing ebuilds]
for packaging the XO stack on Gentoo, and json-py is *not* packaged on
Gentoo. Simply because there are no packages that use it (most packages
use simple-json).
It would be excellent (from Gentoo's POV, and otherwise) if everything
used *one* of these (especially since the interfaces of all three are very
similar). And since cjson is the fastest, most widely used, and is already
a system dep, IMO it should be used.
--
Ticket URL: <http://dev.sugarlabs.org/ticket/156#comment:8>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system
More information about the Bugs
mailing list