From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70007: [PATCH] native JSON encoder Date: Sun, 25 Aug 2024 13:55:53 -0400 Message-ID: References: <1BF559D1-DB9F-4FEB-90ED-72E0EFD76424@gmail.com> <86wmpphrg7.fsf@gnu.org> <4589243D-C11A-45C1-AF3E-6F4A5BADEB54@gmail.com> <864jcrindg.fsf@gnu.org> <291DD5F1-85B8-4647-A40A-EBBD4C51E253@gmail.com> <8634sbijfx.fsf@gnu.org> <2CF47DA5-A65B-47C4-A28A-6FEE1469BD13@gmail.com> <86cyrdfuai.fsf@gnu.org> <3139C8FE-5C67-4FE3-B940-F449DA73E76C@gmail.com> <86le5zdfbi.fsf@gnu.org> <4C93E902-282D-4408-B449-C8E771B2B3E4@gmail.com> <86cyr7agjo.fsf@gnu.org> <850DEC32-F318-4F3E-BA87-55FC6DC74CD3@gmail.com> <86ikvpnbj5.fsf@gnu.org> <867cc5mbq3.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20238"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Andrea Corallo , casouri@gmail.com, Stefan Kangas , 70007@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 25 19:57:29 2024 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 1siHUW-00057I-JP for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Aug 2024 19:57:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1siHUH-0004op-TU; Sun, 25 Aug 2024 13:57:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1siHUG-0004od-N1 for bug-gnu-emacs@gnu.org; Sun, 25 Aug 2024 13:57:12 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1siHUG-00020h-Dn for bug-gnu-emacs@gnu.org; Sun, 25 Aug 2024 13:57:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=nmVnxIc1iLhu8w2nTPx3QrTeUoN+8gC886mD31okhT8=; b=KFbXGVixyx3ExrcLGf+/ezHQHC4xIBV7I/tMCVbq9AbAHqgaDiccGH5AWO8WI27sWFWFv7QBiBBeCzQVl/clYeDo1phPwoeoa6q54EBv9YUECYYdhj1EdNBACmE3l54L20xpG6+Zkf4x3zWmPQr94o8WPO2NkUNlrQ+VJnq4LRzoCzGzSQ8DRyph7axum1fZ2QRQksxYTt6bHeCP/nr93+UToEVaxCHyQOBbdq+bLzbuY+jAvO2scGGo9hp53yREbhDeSTai4OLYHATTPXNfNt2M2EepVYYqB2iyuTKhsORw4P1h9ffkflAjSutDaecSZcU1UXkdrbWtSbpf6yHm9g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1siHV4-0005Rk-7y for bug-gnu-emacs@gnu.org; Sun, 25 Aug 2024 13:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Aug 2024 17:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70007 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70007-submit@debbugs.gnu.org id=B70007.172460862520853 (code B ref 70007); Sun, 25 Aug 2024 17:58:02 +0000 Original-Received: (at 70007) by debbugs.gnu.org; 25 Aug 2024 17:57:05 +0000 Original-Received: from localhost ([127.0.0.1]:43263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1siHU8-0005QG-Lz for submit@debbugs.gnu.org; Sun, 25 Aug 2024 13:57:04 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:61851) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1siHU7-0005Po-C4 for 70007@debbugs.gnu.org; Sun, 25 Aug 2024 13:57:03 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4CA9B80A1B; Sun, 25 Aug 2024 13:56:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1724608564; bh=com2T9oSJekBipea9Q1g7FPzS+V1v859hBv4CRUliDE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=DdQ3oays1+w3KcbFsz+vo7bLWk4ahLU4rLAXQ8IcXVQoYz5wa1FVOzhlzaHO5Yqg5 Zq8OlSoGtjDcN45Vx+LJ3Z9Mq3I2hpybUKWb0ARvKcybj1WrEkIeAMK6wjqi7s+6rM i+9C97y4SIzHT6+jriSoRiBDjdna1J6FkTOF5/HjW7M+qLKAro/LydMHX7ZaqhgJWP Oid2Q2fANclfPe37DWDb0SqagBNFCYqjQmceFRCPpWq6B3pdivpFbZRzqriRKpHsjf nSVbW2aGHE+Bdc2R4pR6xKrS0oKPfbxnqAR/Zk2b9qhnr0CMWIDaRJcZdxT4CXFoTw /oTjdBRUw+q/g== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B77848060A; Sun, 25 Aug 2024 13:56:04 -0400 (EDT) Original-Received: from pastel (unknown [216.154.9.87]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7886C1206D6; Sun, 25 Aug 2024 13:56:04 -0400 (EDT) In-Reply-To: <867cc5mbq3.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 25 Aug 2024 08:07:48 +0300") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290751 Archived-At: >> > Since this could potentially (albeit unlikely) break someone's code, >> > I'm okay with making this change, but with a twist: let's have a >> > variable which could be let-bound around the call to json-serialize, >> > to make the result a multibyte string instead of the default unibyte. >> > This is so if someone comes back crying that we broke his/her code, >> > they could have an easy fire escape. >> Sure, but it's a bit annoying to saddle us with some baggage that we nev= er >> expect to be actually used. >> And for that matter, it's no easier to bind a variable around the call >> than putting a call to `decode-coding-string` around it, is it? We could >> describe that in NEWS. The variable solution has one advantage: users can (setq ... t) in their `.emacs` to keep old code working, tho potentially at the cost of breaking new code. Another option is to introduce a new name (that outputs a unicode string) and obsolete the old one. =F0=9F=99=82 But just making a breaking change is not that bad: ELisp has evolved to be pretty good at making code magically work for both encoded and decoded strings. >> The null option is to do nothing and stick to what we have now. >> It's not a terrible choice either. Returning an encoded strings is something we do want to avoid in the long run, so we might as well bite the bullet now. > Let's see what others think about this. Stefan, Stefan, and Andrea: > any opinions wrt what, if anything, we should do about this on the > emacs-30 branch? I vote for breaking compatibility. Stefan