From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: GNU Guile 2.9.9 Released [beta] Date: Tue, 14 Jan 2020 12:16:32 +0100 Message-ID: <87eew2i8z3.fsf@pobox.com> References: <87zherlphs.fsf@pobox.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="38189"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: guile-devel To: Stefan Israelsson Tampe Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Jan 14 12:18:50 2020 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1irKDi-0009PV-1Q for guile-devel@m.gmane-mx.org; Tue, 14 Jan 2020 12:18:50 +0100 Original-Received: from localhost ([::1]:37198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irKDg-0004EA-0C for guile-devel@m.gmane-mx.org; Tue, 14 Jan 2020 06:18:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51091) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irKBq-0002lk-CB for guile-devel@gnu.org; Tue, 14 Jan 2020 06:16:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irKBn-0004Az-7l for guile-devel@gnu.org; Tue, 14 Jan 2020 06:16:54 -0500 Original-Received: from fanzine.igalia.com ([178.60.130.6]:49723) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irKBk-00049w-FA for guile-devel@gnu.org; Tue, 14 Jan 2020 06:16:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=ZWD4nXElUFXHZyMBpYFmDj6xZjkA1+UbGopCNnVdQV8=; b=ICDOXDuHJr/gjPHjqHPvc/VSNMzSqf+NWOQ0w/v8/26oay3Ay4hXjd+c/CTYiYPDJLLhMyuKPxSgxZEl9SaJj5hpfOSK/xptESGdhzF5jwuyRt3HM5qIhxCTDR3YO+CStVMHHGiTRyw0fgfQegkIH3KuIqIdw7CX8VW/nnK1wh9EekdUW6y37nTMCcWPBkwjW/FboKXV2m8kEMxRH651Xo/4kSWh+1bASNlDhZZ+U3trC3QC0K1vCZDk6uQD5X3/Ys+J/qQ19zeBcVcmz50azDVcPl4pkDdAlai5R/HjAsxuVo3Chdg7e4KhBmZr6CO46/uX0VFnhhz1YH8aU/nv8A==; Original-Received: from [37.164.23.188] (helo=sparrow) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1irKBf-00045O-DC; Tue, 14 Jan 2020 12:16:43 +0100 In-Reply-To: (Stefan Israelsson Tampe's message of "Mon, 13 Jan 2020 22:32:08 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 178.60.130.6 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:20262 Archived-At: On Mon 13 Jan 2020 22:32, Stefan Israelsson Tampe writes: > In current guile (eq? f f) = #f for a procedure f. Try: Note that procedure equality is explicitly unspecified by R6RS. Guile's declarative modules optimization took advantage of this to eta-expand references to declaratively-bound top-level lambda expressions. This unlocks the "well-known" closure optimizations: closure elision, contification, and so on. However, the intention with the eta expansion was really to prevent the (module-add! mod 'foo foo) from making the procedure not-well-known. If that's the only reference to `foo' outside the operator position, procedure identity for `foo' is kept, because it's only accessed outside the module. But then I realized thanks to your mail (and the three or four times that people stumbled against this beforehand) that we can preserve the optimizations and peoples' intuitions about procedure equality if we restrict eta-expansion to those procedures that are only referenced by value in at most a single position. It would be best to implement the eta-expansion after peval; doing it where we do leaves some optimization opportunities on the table. But I have implemented this change in git and it should fix this issue. Comparative benchmark results: https://wingolog.org/pub/guile-2.9.7-vs-guile-2.9.9-with-eq-change-microbenchmarks.png Regards, Andy