[Q] Import Edward O'Connor's json.el.

Aidan Kehoe kehoea at parhasard.net
Thu Dec 14 07:58:45 EST 2006


 Ar an triú lá déag de mí na Nollaig, scríobh Stephen J. Turnbull: 

 >  > An issue with this is that the package uses encode-char and
 >  > decode-char with 'ucs as an argument, something 21.4 doesn’t have
 >  > without Mule-UCS, and which non-Mule builds don’t have at all. This
 >  > means I have to edit it to be compilable by non-Mule 21.4, but if
 >  > anyone has objections to the other aspects of the import, I’d love to
 >  > hear them.
 > 
 > Non-mule is basically a non-starter for 'net content-related work
 > these days for precisely that reason.  I wouldn't have a problem with
 > moving it to a Mule package.
 > 
 > This doesn't belong in net-utils.  Nor does xml.el, for that matter.
 > We'll have to think about the implications of moving xml.el, but let's
 > not follow that precedent here.
 > 
 > The existing package that fits best is prog-modes, 

It doesn’t fit in prog-modes at all. JSON is a data format, like ASN.1,
S-expressions, and XML. (Though closest in spirit to S-expressions; the
ability to do an eval() in JavaScript is one of its selling points.) The
library converts JSON-encoded data to Lisp data types, and vice-versa. It
doesn’t add support for interactively editing JSON files in XEmacs, since
javascript-mode already provides that adequately.

This is not a mode. This is a library for Lisp programming. net-utils fits
best, though I agree that it’s not ideal. 

 > but that's not a good idea because I expect there must be several of
 > these guys around;

There doesn’t appear to be. The intersection of Emacs Lisp coders with
Web-2.0 enthusiasts is a lonely place. 

 > they should be collected in one, reasonably well-named place.  I
 > suggest consulting with Norbert, and Ville and Steve Youngs if they're
 > around, about creating a new package "web-content-modes".  (Probably
 > you can come up with a better name.  Maybe it should be "-utils" for a
 > collection of small things.)  Or if we've got other js-related
 > libraries, a javascript-modes package.

JSON is intended to be used independently of JavaScript; it doesn’t make a
huge amount of sense to create a javascript-modes package for its sake. From
json.org:

  “JSON (JavaScript Object Notation) is a lightweight data-interchange
  format. It is easy for humans to read and write. It is easy for machines
  to parse and generate. It is based on a subset of the JavaScript
  Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON
  is a text format that is completely language independent but uses
  conventions that are familiar to programmers of the C-family of languages,
  including C, C++, C#, Java, JavaScript, Perl, Python, and many others.
  These properties make JSON an ideal data-interchange language.”

It’s ideal when you’re passing server-side data to client-side web
applications, and since server-side programs can be in almost any language,
and since support for JSON is not complicated to implement, a long list of
languages supports the format.

-- 
“No one can guarantee that any course of action in Iraq at this point will
stop sectarian warfare, growing violence, or a slide toward chaos.”
(Iraq Study Group Report, Dec. 6, 2006)



More information about the XEmacs-Patches mailing list