From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Default lexical-binding to t Date: Wed, 6 Nov 2024 17:42:29 +0000 Message-ID: References: <86ttcnuppm.fsf@gnu.org> <86ttcksgsu.fsf@gnu.org> <86bjysscvr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10515"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 06 18:43:46 2024 Return-path: Envelope-to: ged-emacs-devel@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 1t8k4H-0002du-4B for ged-emacs-devel@m.gmane-mx.org; Wed, 06 Nov 2024 18:43:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8k3E-00036l-Jc; Wed, 06 Nov 2024 12:42:40 -0500 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 1t8k3A-00036B-NQ for emacs-devel@gnu.org; Wed, 06 Nov 2024 12:42:38 -0500 Original-Received: from mail.muc.de ([193.149.48.3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t8k37-0006Op-0h for emacs-devel@gnu.org; Wed, 06 Nov 2024 12:42:35 -0500 Original-Received: (qmail 73876 invoked by uid 3782); 6 Nov 2024 18:42:29 +0100 Original-Received: from muc.de (p4fe15b0f.dip0.t-ipconnect.de [79.225.91.15]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 06 Nov 2024 18:42:29 +0100 Original-Received: (qmail 1776 invoked by uid 1000); 6 Nov 2024 17:42:29 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.3; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325184 Archived-At: Hello, Stefan. On Wed, Nov 06, 2024 at 11:32:10 -0500, Stefan Monnier wrote: > >> They should likely add a `lexical-binding:nil` cookie and move on. > > In each and every file? > Yup. > > Not a simple thing to do. > It doesn't require any thought, so I consider it simple. > Also, there shouldn't be so terribly many such files remaining nowadays. > But if experience shows it to be a problem, I guess we could provide > a command that automates it. > >> Of course, they can also change this cookie to `t` temporarily every > >> once in a while to see if it uncovers a problem or not, so the > >> conversion can be done bit by bit. > > For some code that gets executed only rarely, this is not practical. > I don't see why. > > Can you tell what are the benefits of turning on lexical-binding by > > default, relative to what we have now? > IME, nowadays lexbind is the "de facto" default used for all > new ELisp code, including code snippets posted around the web. > So using dynbind when there's no cookie is often a source of errors > and confusion. Maybe briefly explaining the philosophy of lexical binding somewhere (maybe NEWS) would help. I still don't understand it. I go along with lexical binding because quite a lot of people cleverer than me have said it is good. But why? It doesn't seem to make code run faster (I think CC Mode became marginally slower after the conversion to lexical binding). OK, we can create closures, but so what? What user features in Emacs have become possible, or practical, because of lexical binding? I'm not trying to be argumentative here. I'm just puzzled about it, as I have been for quite a number of years. > Stefan -- Alan Mackenzie (Nuremberg, Germany).