From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: Proper namespaces in Elisp Date: Mon, 04 May 2020 21:59:27 +0000 Message-ID: References: <237fe643-c14d-5406-b35d-a30dcd42c5ed@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="118212"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: nic@ferrier.me.uk, =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel , emacs-devel , Stefan Monnier , Helmut Eller To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 05 00:01:38 2020 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 1jVj9e-000Ug9-E2 for ged-emacs-devel@m.gmane-mx.org; Tue, 05 May 2020 00:01:38 +0200 Original-Received: from localhost ([::1]:41674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVj9d-0002ob-EK for ged-emacs-devel@m.gmane-mx.org; Mon, 04 May 2020 18:01:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVj87-0001rL-QB for emacs-devel@gnu.org; Mon, 04 May 2020 18:00:03 -0400 Original-Received: from mx.sdf.org ([205.166.94.20]:58516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVj85-0001c9-8m for emacs-devel@gnu.org; Mon, 04 May 2020 18:00:03 -0400 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 044LxRPm016721 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Mon, 4 May 2020 21:59:27 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 044LxRKe017776; Mon, 4 May 2020 21:59:27 GMT In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Mon, 4 May 2020 20:02:04 +0100") Received-SPF: pass client-ip=205.166.94.20; envelope-from=akrl@sdf.org; helo=mx.sdf.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 17:59:53 X-ACL-Warn: Detected OS = ??? 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_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:248915 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > On Mon, May 4, 2020 at 7:30 PM Helmut Eller wrot= e: >> should be done by the compiler (like lexical scoping). In other words, >> those people would like a mechanism to manage the names of variable >> bindings not a mechanism to manage symbols. > > That last sentence sounds clever but I can't fully grok it. Do you > really mean "variable bindings" or just "bindings"? (including function's= ). > > On Mon, May 4, 2020 at 7:39 PM Stefan Monnier = wrote: >> Richard mentioned his profound dislike of solutions that operate in >> the reader. I'm not sufficiently familiar with Common Lisp's package >> system to have a strong opinion on that, but Richard's criticism does >> appeal to me (I've been brought up on namespace systems more like >> Standard ML's structures). > > I can't even imagine what a solution that _doesn't_ operate on the reader > looks like. Are you talking about form walking macros that walk the > forms and switch the short version of names into the long versions > and intern everything into the same obarray? Hmmm. Namespaces in the read time is a bad idea because it does not affect only bindings but effectively all symbols. I, as many others, do not like CL package system too for this reason and all its implications. For having a namespace system that works only on bindings a new indirection must be added. That implies that implementation-wise you cannot keep the symbol-value directly in the symbol. In this way you can have more consumers of the same binding (that is what happend when you import from another namespace). One could argue that this will cause a slow down in code execution but this is non true given this indirection has to be solved in the compile-time for compiled or byte-compiled code. Effectively namespace resolution is then moved from the read-time to the compile-time. And with that you solve also the problem of the code walker because the compiler it is already *the* code walker. I think Emacs has most of the infrastructure to implement this already in the codebase but right now I've not time to work on a prototype (I'm not sure either how much this feature is really desired). Andrea -- akrl@sdf.org