From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] ice-9: Add JSON module. Date: Mon, 21 Sep 2015 22:08:13 +0200 Message-ID: <87si67zgb6.fsf@gnu.org> References: <87vbcg1c4d.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1442866141 15256 80.91.229.3 (21 Sep 2015 20:09:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Sep 2015 20:09:01 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Sep 21 22:08:51 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 1Ze7ON-0001Vl-2W for guile-devel@m.gmane.org; Mon, 21 Sep 2015 22:08:51 +0200 Original-Received: from localhost ([::1]:60977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze7OL-00076y-Rs for guile-devel@m.gmane.org; Mon, 21 Sep 2015 16:08:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze7O6-00070a-Hz for guile-devel@gnu.org; Mon, 21 Sep 2015 16:08:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ze7O3-0001m9-1Z for guile-devel@gnu.org; Mon, 21 Sep 2015 16:08:34 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:33075) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze7O2-0001lS-Rq for guile-devel@gnu.org; Mon, 21 Sep 2015 16:08:30 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ze7Nz-00010a-21 for guile-devel@gnu.org; Mon, 21 Sep 2015 22:08:27 +0200 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Sep 2015 22:08:27 +0200 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Sep 2015 22:08:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Jour des =?utf-8?Q?R=C3=A9compenses?= de =?utf-8?Q?l?= =?utf-8?Q?'Ann=C3=A9e?= 223 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x3D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Cancel-Lock: sha1:f/+NJV7NbtCg3hG43qkRW8OxkDI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:17845 Archived-At: David Thompson 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’s also guile-json, bindings to a C library, but I think it’s 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? > +(define (json-error port) > + (throw 'json-error port)) This won’t print correctly, unless there’s an exception printer installed in boot-9.scm (see ‘getaddrinfo-error’ for instance.) Could you add one? Also, I think we need more details about the error: parse error, what kind, etc. Would it work to use the parser from (language ecmascript parse), possibly restricting it? Or do you think it’s more viable to have a separate parser because there are too many differences? Is there a standard test suite that we could test it against, somehow? Otherwise LGTM. Thanks, and sorry for the delay! Ludo’.