From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler Newsgroups: gmane.emacs.bugs Subject: bug#55278: json-parse-string Date: Mon, 9 May 2022 12:39:54 +0200 Message-ID: <4534cafd-6e16-1ec6-1986-3ef441a5d5e8@daniel-mendler.de> References: <4f91dfed-1563-fd76-a9a0-b5405718ae20@daniel-mendler.de> <87o8079f1s.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25315"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic , 55278@debbugs.gnu.org To: Lars Ingebrigtsen , Richard Stallman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 09 13:15:32 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1no1MR-0006QR-LH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 May 2022 13:15:31 +0200 Original-Received: from localhost ([::1]:51428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no1MQ-00073g-KJ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 May 2022 07:15:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no0p4-0007DH-Oy for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 06:41:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34179) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1no0p4-0004b2-Ey for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 06:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1no0p4-000516-Df for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 06:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 May 2022 10:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55278 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 55278-submit@debbugs.gnu.org id=B55278.165209281919224 (code B ref 55278); Mon, 09 May 2022 10:41:02 +0000 Original-Received: (at 55278) by debbugs.gnu.org; 9 May 2022 10:40:19 +0000 Original-Received: from localhost ([127.0.0.1]:56309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no0oN-000500-4e for submit@debbugs.gnu.org; Mon, 09 May 2022 06:40:19 -0400 Original-Received: from server.qxqx.de ([178.63.65.180]:39377 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no0o7-0004z2-3N for 55278@debbugs.gnu.org; Mon, 09 May 2022 06:40:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=P6pejEQ/UqpcURPLE4sUjon3baFFjDMRSisdiM0cXHM=; b=gq9l1zQmT2Gmw3SpY/QMiJWlOV fYSYCOv0GfypykB9RVQPoSQUnDloqEGKWPmbWlE/lC37t3X4Ty84BUMZpWsZuxcQ4uPLEFxiXVD9Q BR7EUVb2YfDbSeVd3UeJ4LHYOsSCWjL+HFPXlszS5UJfRi9LkAUIzsMP3e8yXUEbV/vU=; Content-Language: en-US In-Reply-To: <87o8079f1s.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:231719 Archived-At: On 5/9/22 12:27, Lars Ingebrigtsen wrote: > Richard Stallman writes: > >> I agree that we should implement some built-in fallback mechanism >> so that it works for all packages that use json parsing. > > The two libraries aren't really compatible without reparsing the entire > parse tree returned by them. For instance, the C library returns: The json-parse-string implementation in compat.el should be compatible as far as I understood Philip and it relies on json.el. > Libraries like osm.el depend on the former type, and it parses a lot of > data, making compat transformations prohibitively slow. We'd be doing > our users a disservice if we were to just be slow here instead of > telling them the real story: Build your Emacs with jansson support, > already. (This happens by default if you have the library installed.) Yes, that's a good point. Should we rather bail out or try to do our best by falling back to a slower implementation? For example eww bails out if libxml is missing, probably rightly so. In osm-mode I have a list of requirements which must be satisfied before it can be used reasonably. These requirements are also listed in the README and in the Commentary of the package. (unless (display-graphic-p) (warn "osm: Graphical display is required")) (dolist (type '(svg jpeg png)) (unless (image-type-available-p type) (warn "osm: Support for %s images is missing" type))) (unless (libxml-available-p) (warn "osm: libxml is not available")) (unless (ignore-errors (equal [] (json-parse-string "[]"))) (warn "osm: libjansson is not available")) Daniel