From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] ice-9: Add JSON module. Date: Tue, 22 Sep 2015 02:49:37 -0400 Message-ID: <87h9mneyny.fsf@netris.org> 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1442904683 6968 80.91.229.3 (22 Sep 2015 06:51:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Sep 2015 06:51:23 +0000 (UTC) Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , guile-devel@gnu.org To: Matt Wette Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Sep 22 08:51:13 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 1ZeHPx-0002V9-LW for guile-devel@m.gmane.org; Tue, 22 Sep 2015 08:51:09 +0200 Original-Received: from localhost ([::1]:37048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeHPw-0000Va-TA for guile-devel@m.gmane.org; Tue, 22 Sep 2015 02:51:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeHPs-0000VQ-U6 for guile-devel@gnu.org; Tue, 22 Sep 2015 02:51:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeHPo-0001FD-U0 for guile-devel@gnu.org; Tue, 22 Sep 2015 02:51:04 -0400 Original-Received: from world.peace.net ([50.252.239.5]:47012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeHPo-0001Ep-QT; Tue, 22 Sep 2015 02:51:00 -0400 Original-Received: from [10.1.10.32] (helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1ZeHPh-0006Lc-20; Tue, 22 Sep 2015 02:50:53 -0400 In-Reply-To: (Matt Wette's message of "Mon, 21 Sep 2015 18:31:07 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 50.252.239.5 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:17849 Archived-At: Matt Wette writes: > On Sep 21, 2015, at 1:08 PM, Ludovic Court=C3=A8s wrot= e: > >=20=20=20=20=20 > David Thompson skribis: >=20=20=20=20=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=20=20=20=20=20=20=20=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=20=20=20=20 > I wonder if we should introduce it in 2.0. What do people think? >=20=20=20=20=20 > > I would be happy to have this in the core; I have used it. Agreed. > 1. There is a minor typo in the source: should be "denominator.=E2=80=9D Indeed, good catch! > 2. The comments say integers are converted to exact and floating point > to inexact, but the code will convert 1.0 to exact. In Scheme terminology, 1.0 is an integer. > 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? >=20=20=20=20=20 > > I vote for separate parser, the json.scm file is lightweight. > json.scm.go is < 17k. Agreed. The simplicity also allows confidence that it can safely handle potentially malicious JSON data. Mark