From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] ice-9: Add JSON module. Date: Mon, 21 Sep 2015 18:31:07 -0700 Message-ID: References: <87vbcg1c4d.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87si67zgb6.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_A7DF0FD4-B7E6-4A72-8362-212AE4133435" X-Trace: ger.gmane.org 1442885502 5694 80.91.229.3 (22 Sep 2015 01:31:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Sep 2015 01:31:42 +0000 (UTC) Cc: guile-devel@gnu.org To: =?utf-8?Q?Ludovic_Court=C3=A8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Sep 22 03:31:32 2015 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZeCQe-0000CR-9Z for guile-devel@m.gmane.org; Tue, 22 Sep 2015 03:31:32 +0200 Original-Received: from localhost ([::1]:35269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeCQc-00024w-Qy for guile-devel@m.gmane.org; Mon, 21 Sep 2015 21:31:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeCQY-00024p-Pr for guile-devel@gnu.org; Mon, 21 Sep 2015 21:31:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeCQV-0000S3-Jk for guile-devel@gnu.org; Mon, 21 Sep 2015 21:31:26 -0400 Original-Received: from vms173017pub.verizon.net ([206.46.173.17]:55208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeCQV-0000HD-EC; Mon, 21 Sep 2015 21:31:23 -0400 Original-Received: from [192.168.2.127] ([71.106.140.79]) by vms173017.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0NV20090C1JVCOD0@vms173017.mailsrvcs.net>; Mon, 21 Sep 2015 20:31:08 -0500 (CDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=WcjxEBVX c=1 sm=1 tr=0 a=U5cW0FdS3jYB8mZKAXjpug==:117 a=o1OHuDzbAAAA:8 a=oR5dmqMzAAAA:8 a=ff-B7xzCdYMA:10 a=mDV3o1hIAAAA:8 a=grhEbB_mkQQimPH-hrkA:9 a=QEXdDO2ut3YA:10 a=AIr1G-pG3V8YFcsBeTMA:9 a=yx8mvDgq8p8o3vpW:21 a=_W_S_7VecoQA:10 In-reply-to: <87si67zgb6.fsf@gnu.org> X-Mailer: Apple Mail (2.2104) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.46.173.17 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17847 Archived-At: --Apple-Mail=_A7DF0FD4-B7E6-4A72-8362-212AE4133435 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Sep 21, 2015, at 1:08 PM, Ludovic Court=C3=A8s = wrote: >=20 > David Thompson skribis: >=20 >> JSON is an commonly encountered format when writing web applications, >> much like XML, and I think it would be a good idea if the core Guile >> distribution had an SXML equivalent for JSON. This patch introduces >> such an interface in the (ice-9 json) module. >=20 > There=E2=80=99s also guile-json, bindings to a C library, but I think = it=E2=80=99s > better to have a pure Scheme implementation, and to have it in Guile > core. >=20 > I wonder if we should introduce it in 2.0. What do people think? I would be happy to have this in the core; I have used it. A few = comments: 1. There is a minor typo in the source: should be "denominator.=E2=80=9D 2. The comments say integers are converted to exact and floating point = to inexact, but the code will convert 1.0 to exact. > Would it work to use the parser from (language ecmascript parse), > possibly restricting it? Or do you think it=E2=80=99s more viable to = have a > separate parser because there are too many differences? I vote for separate parser, the json.scm file is lightweight. = json.scm.go is < 17k. --Apple-Mail=_A7DF0FD4-B7E6-4A72-8362-212AE4133435 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On = Sep 21, 2015, at 1:08 PM, Ludovic Court=C3=A8s <ludo@gnu.org> = wrote:

David = Thompson <davet@gnu.org> skribis:

JSON is an commonly = encountered format when writing web applications,
much = like XML, and I think it would be a good idea if the core Guile
distribution had an SXML equivalent for JSON.  This = patch introduces
such an interface in the (ice-9 json) = module.

There=E2=80=99s also = guile-json, bindings to a C library, but I think it=E2=80=99s
better to have a pure Scheme implementation, and to have it = in Guile
core.

I wonder if we = should introduce it in 2.0.  What do people think?


I would be happy to have this in the core; I have = used it.  A few comments:

1. There is a minor typo in the source: should be = "denominator.=E2=80=9D
2. The comments say integers are = converted to exact and floating point to inexact, but the code will = convert 1.0 to exact.

Would it work to use the parser = from (language ecmascript parse),
possibly restricting it? =  Or do you think it=E2=80=99s more viable to have a
separate parser because there are too many differences?

I vote for = separate parser, the json.scm file is lightweight.  json.scm.go is = < 17k.

= --Apple-Mail=_A7DF0FD4-B7E6-4A72-8362-212AE4133435--