From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.devel Subject: Fwd: GNU Guile 2.9.9 Released [beta] Date: Tue, 14 Jan 2020 12:43:17 +0100 Message-ID: References: <87zherlphs.fsf@pobox.com> <87eew2i8z3.fsf@pobox.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b622cf059c181945" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="194255"; mail-complaints-to="usenet@blaine.gmane.org" To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Jan 14 13:10:51 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 1irL23-000o1D-Aa for guile-devel@m.gmane-mx.org; Tue, 14 Jan 2020 13:10:51 +0100 Original-Received: from localhost ([::1]:38248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irL21-0001mQ-Pz for guile-devel@m.gmane-mx.org; Tue, 14 Jan 2020 07:10:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56741) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irKbb-0001U2-Q1 for guile-devel@gnu.org; Tue, 14 Jan 2020 06:43:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irKba-0003vG-5v for guile-devel@gnu.org; Tue, 14 Jan 2020 06:43:31 -0500 Original-Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:43394) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irKbZ-0003ur-Rz for guile-devel@gnu.org; Tue, 14 Jan 2020 06:43:30 -0500 Original-Received: by mail-wr1-x42d.google.com with SMTP id d16so11826704wre.10 for ; Tue, 14 Jan 2020 03:43:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=kTqVpN31ew65Lj7DPIPKXOkikso6kaIgyprMeXDCxbQ=; b=IBm3vNPAAj/P2rHCM2b9DnTtORmdMeD7ivxzjl/8kN9IVuVhwYEZXljOl0ToSNQz69 V2S0HMB2XCLPUZ9oq/196C2pT4cBr1v5oCILk+1QEQBJ0bK92IpV5+RBjccyzGO2lJMQ 0fXSpJ7yho7wAEI/JxwABd8s6w+FNXGAiOccSeNoBrcrnQnz0w4lKsJIeVHZn+qnfoy4 sWbatfwSPcB9ZeZ8t+wZu6Hoa0zU8inFmPN7cxYX94ERyDXh+R46pzXXz67FHkxkGj1l 2r3M6yo8FDO58Lr60TSpBUi7pQ2wS7NOsgtl7Kb/xtAHipXfGKyQiadOB6hMKpdVjmWa hPKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=kTqVpN31ew65Lj7DPIPKXOkikso6kaIgyprMeXDCxbQ=; b=Jr04nPhe/YFAlK5shukZj3zHwsw6YPUmFY3+7SY5xnI50aw9eAu03qQ0NYZMcNglKt 83j5C8PJknLCVqWIhyjGpJX7DLdV5+ufwWCPvecZiSHUfSx1s4oXBXjAdPIyi0sCesFs AjTQ18edxPcBgGzxihs9ZvFcMLaJndgulsNVmy01tT77cdG5weEzavDwpnucgNEtIM4z wV/PXUS6h6SiZ6NRYh2ErettmrFnm/Z08uQxMsIonrkbybOsyq7/02DxzQ9NOTVvanUx cB605kZYZ1o88yudpQXnLHMygEjQ2x6BzSqXGonGFlfgF24GQPKDh+BqbGQwrfLUrk6d ZvcQ== X-Gm-Message-State: APjAAAWHPIvz2l1zT0qWHi3AkIy9uujfTeMrTuh+J9Qwm53QtFn916+j lq++1lSdIGZjL2x0VzC9oNEpgVrnnRQrRIBsoXSt5A== X-Google-Smtp-Source: APXvYqwGwIVRfhhVtmzVvSaliaGgfR80317qi4t07U5wcjdlmJV59WzFXO1lXh8/DVgm4360x846Ab10G1bZZBeMOA0= X-Received: by 2002:adf:d4ca:: with SMTP id w10mr23353531wrk.53.1579002208067; Tue, 14 Jan 2020 03:43:28 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d 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:20263 Archived-At: --000000000000b622cf059c181945 Content-Type: text/plain; charset="UTF-8" ---------- Forwarded message --------- From: Stefan Israelsson Tampe Date: Tue, Jan 14, 2020 at 12:43 PM Subject: Re: GNU Guile 2.9.9 Released [beta] To: Andy Wingo Thanks! Phew! I think that for an f, a direct function application need not to be counted as a position. Only when you use f in a higher order manner demands that you count this. E.g. (g f), (return f) Regards Stefan On Tue, Jan 14, 2020 at 12:16 PM Andy Wingo wrote: > 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 > --000000000000b622cf059c181945 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


---------- Forwarded message ---------
From: Stefan Israelsson Tampe <stefan.itampe@= gmail.com>
Date: Tue, Jan 14, 2020 at 12:43 PM
Subject:= Re: GNU Guile 2.9.9 Released [beta]
To: Andy Wingo <wingo@pobox.com>


Thanks!

Phew!

I think that fo= r an f, a direct function application need not to be counted as a position.= Only when you use f in a higher order manner
demands that you co= unt this. E.g. (g f), (return f)

Regards
Stefan

On Tue, Jan 14, 2020 at 12:16 PM Andy Wingo <wingo@pobox.com> wrote:
On Mon 13 Jan 2020 22= :32, Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:

> In current guile (eq? f f) =3D #f for a procedure f. Try:

Note that procedure equality is explicitly unspecified by R6RS.=C2=A0 Guile= 's
declarative modules optimization took advantage of this to eta-expand
references to declaratively-bound top-level lambda expressions.=C2=A0 This<= br> unlocks the "well-known" closure optimizations: closure elision,<= br> contification, and so on.

However, the intention with the eta expansion was really to prevent the

=C2=A0 (module-add! mod 'foo foo)

from making the procedure not-well-known.=C2=A0 If that's the only refe= rence
to `foo' outside the operator position, procedure identity for `foo'= ; is
kept, because it's only accessed outside the module.=C2=A0 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.=C2=A0 But = I
have implemented this change in git and it should fix this issue.

Comparative benchmark results:

=C2=A0 https:/= /wingolog.org/pub/guile-2.9.7-vs-guile-2.9.9-with-eq-change-microbenchmarks= .png

Regards,

Andy
--000000000000b622cf059c181945--