From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: A prototype for a binding based approach to proper namespaces Date: Sat, 09 May 2020 08:56:21 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="us-ascii" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="80622"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: AquaMail/1.24.0-1585 (build: 102400006) Cc: emacs-devel@gnu.org To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 09 17:58:53 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 1jXRsK-000Kps-Ve for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 17:58:52 +0200 Original-Received: from localhost ([::1]:58354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXRsJ-0003fO-8P for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 11:58:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXRpw-0001KG-GT for emacs-devel@gnu.org; Sat, 09 May 2020 11:56:24 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:56638) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXRpu-0002je-Py for emacs-devel@gnu.org; Sat, 09 May 2020 11:56:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:References:In-Reply-To:Date:CC:To:From: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=YJlpkQa5bZOTL/zsOwXo6DuZxoZz84OA6XOwQNGUvuU=; b=bHmf9vwDHonVX9Tl/qNiepnP8W 3x3uuDbZZJjaLpP0nvUPXBJ5Zu10g+itLl4x7pLlf/XE3PhsbyCFd0SRel27zBjQPtuoQ4Vmv/Pam E+MlS3FqetsbB3LQ813hO1rYtJLlXivQQiZLXi3nOnvcR4E2WoTq0DCqugxRNSS6xKUsN30Kg7utR DGxqGUBfaxs5miTwqh5fegObY6ZJ3sn8cQJHReC7s4FThzBexyZADR487HiwWLQMksFZJRNs3a+rh yvet/np6fE1KP3FcDoRHh4YWnjcdD2jrt6dbL2Xa/E7rX8OJy6/OfjBPPwLuhnGILrRcq0GfjBbaI P5sZRwzg==; Original-Received: from [172.92.145.124] (helo=[192.168.86.155]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jXRpt-00082T-FE; Sat, 09 May 2020 08:56:21 -0700 In-Reply-To: Received-SPF: pass client-ip=2600:3c01::f03c:91ff:fedf:adf3; envelope-from=dancol@dancol.org; helo=dancol.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, 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:249486 Archived-At: On May 9, 2020 8:51:23 AM Andrea Corallo wrote: > Daniel Colascione writes: > >>> I think it depends on how resilient you want to have your language to >>> redefinitions. Say you have four libraries B derived from A and C from >>> B etc: >>> >>> A <= B <= C <= >> >> >> We don't have these problems at all with an approach based on symbol >> rewriting in the reader. Even one additional pointers chase at runtime >> is too much, especially since we're considering using this mechanism >> as a routine way to access module provided facilities and not as a >> rare patch for papering over other problems, as with existing symbol >> aliases. (Thanks to modern memory architectures, each pointer chase is >> brutal.) Yes, I dislike reader magic, but I dislike runtime overhead a >> lot more. > > I agree with you in principle, but the fact that a pointer chase more is > negative for performance in a measurable way or not for this case should > be verified with a measure Death by a thousand cuts is something that happens to lots of real world programs. I don't want to introduce unnecessary memory indirections or branches where simple and efficient alternatives are known to exist and where they're just as good as the inefficient option. > Cache misses in modern architectures can be expansive but also caches > are now very big. I'm pretty sure that if you have a good locality on > bindings given we often hit there cache misses should't be much of a > problem. No. We need those caches for *other* things too. > I'm sure you know it but for public record: this argument obviously > applies to global variables only, locals in lexical code are not > effected. > >>> E has visibility on ~everything was defined in A. Now what if while >>> running A changes the value of something used by E? We need at least >>> one indirection to handle that otherwise you would be pointing still to >>> the original object. But it is more complex because while running B >>> could decide to unimport the definition from A and define the variable >>> locally, >> >> Why should we support this kind of post definition namespace modification? > > I think is good to support it not to have to restart Emacs while > developing. Python restarts all the time, Emacs depends on the user > habit :) A symbol rewriting approach supports unloading and reloading just as well as we support it today, which seems adequate. Symbol rewriting is, in general, a much smaller departure from how things work today.