From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id QOIKLeUtNWbZeAAAqHPOHw:P1 (envelope-from ) for ; Fri, 03 May 2024 20:33:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id QOIKLeUtNWbZeAAAqHPOHw (envelope-from ) for ; Fri, 03 May 2024 20:33:09 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Rann9TSu; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1714761189; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=+2xr5UTEkDscJjSkJFJFKQpg51ybO/UuE7kyesxP0/k=; b=ttrlT1qVFR7MKpaO3dlkLWCeg+65x19HTx5HLSeGBQf3Fpvk4IadeIDaOL1p0FnCV/5lT4 QB8lABxORT5BcHpmuulyzjnKqCrdz6tJ3kBM2ae1906azmrSRBw3h3sCpnlw2rpYsPP0Jn YNpRj5SxoMQ3M+A1b+jNoqdYfesIMYu3o1TrRvnu/2VkVjOwSH8McKbYkQCUxVCgXp+vuM u6XjXZufs7BX8gpMc5LEkl5/8JmuV68VRBSgOmss7cB/jJAwul1QT3hpLdl6OfnPvtoNh5 1LLjTUXQFP2amB8OP9uE5CYZEG5+MAhAkcZXCZqRsY1B4kWT9QrxByAOmEyGNA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1714761189; a=rsa-sha256; cv=none; b=tUvueUCYcEuZJu3nrB0K2ns7r+XeebbF1v/qJ5IxmbO6xq1bFhe/Hg6EoKXNdRMdBapTmd OL8QGTDp5FBgBxPf9LIKOV7zG0hA0GuaDApihnEDjDegi3CSN4gp0Dk+Dybvs36eKRPFI+ Si2Fv6EzKO5jBc94qv+q+B17eJBOpOdRl5HXg0IFqC4pH5pAD/5PjROUfnmqMphsJhpNQS dQ7IX+1okRxI7lFt2ombQWtZ9wJMRPTdt3E9tDH0uPwAN/yALNN2gyOeHCEqH5Fpwhxoul IUpZJu9H98u/4jExKDO8bbpL/v3NF80ehsK+bbCSD2eav1zdEF+YH5dszPu/Xg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Rann9TSu; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7025477BB6 for ; Fri, 03 May 2024 20:33:09 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2xhv-0007is-8y; Fri, 03 May 2024 14:32:31 -0400 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 1s2xht-0007gw-Iu for guix-devel@gnu.org; Fri, 03 May 2024 14:32:29 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2xhr-0003eo-W1; Fri, 03 May 2024 14:32:29 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-41bd8bdd065so17335e9.3; Fri, 03 May 2024 11:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714761145; x=1715365945; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+2xr5UTEkDscJjSkJFJFKQpg51ybO/UuE7kyesxP0/k=; b=Rann9TSug/HHf/f7eErM86DGyMX1Awn1/jYhdXCISSZ7u2xd0tDJHsAHbSImfc6i/4 V+dWNU408vSlq1qZaNFyZAbmuIuEgeZqfMLc1m6AKXBNii89kPhcll7wo2hQsZIFOrQP D6dMyKg1CiifryQQEAO5WcFwESoQ4zJUKc7p5iB9owgHsXjI2vdQuPY5SVnrsqdaBirB ZU/QB/7iWNpnwAI6elfF6TI+VNWVXrwd2ajQ5tOCd6HeBVwp0+RViIgs5wtnM7QzBZf5 gfdFAL3bfw2o5tCleUo92hL02oGOu2jbQZ0v8s+XPFPbj6q2V3r4UHpAajJRzbNN5l2I FJAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714761145; x=1715365945; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+2xr5UTEkDscJjSkJFJFKQpg51ybO/UuE7kyesxP0/k=; b=TWxTFoDG8VDS7PMI8emzVeTwfLszE20baBt5qGYZMXVVPjf8iKsqFGBY5HB3dkG5Pl J43V3I0RtYAVLOASjw59OtYYd3bJEGyP0p1DPMbSfFbXYMsCK34dtkrxmKmhpSN/CPMz 8XCfI3WSt46v/oVklgoABIGqG0aJ43wW/TbHGBfecYmNiEATmpbAB7M76Eatt0CHZvfq RwdPrs/xaVSmPF+BHgthHdXmC2QTKN+nifd5pr90bplvVwLupVkDqaVxxyB94hp1OkDn vkPFG0MMeScOt8t4jsaK7WDPMrTG0VOsJUlxI9onw7ChgcDqsw5yccAvQFzFMvO5tPcO Cwsw== X-Forwarded-Encrypted: i=1; AJvYcCUL8qlfCob0dCqwPLIK0THNDp3Yrg8FlRlEcNaTv/bqH81M3wXe+TtGtLjVqDm/bIkt3CHgCStEPR67EDg= X-Gm-Message-State: AOJu0YwBm8SP27yHTJ3bdMbHSV7BJd+PQ8GTApZSqnx7oqT/1uOp76Bd EYQRgpfeyAfZ391XSY353dG22MFQ1q9iQ4XohlP22GgWpRG2Ls2KSh2NXg== X-Google-Smtp-Source: AGHT+IENYOwhePbf0mRrJ/V5f5BBUBmIGDU6O1PRX3vL/3jA0p/JuH8F3f4ViSR/U/vFBT3DUTOwlQ== X-Received: by 2002:a5d:6ac1:0:b0:34b:dc52:266d with SMTP id u1-20020a5d6ac1000000b0034bdc52266dmr2648407wrw.3.1714761145449; Fri, 03 May 2024 11:32:25 -0700 (PDT) Received: from lili (roam-nat-fw-prg-194-254-61-44.net.univ-paris-diderot.fr. [194.254.61.44]) by smtp.gmail.com with ESMTPSA id i15-20020adfb64f000000b0034af40b2efdsm4359478wre.108.2024.05.03.11.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 11:32:25 -0700 (PDT) From: Simon Tournier To: Andy Wingo Cc: Guix Devel , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: Guile CSE elimination of record accessor? In-Reply-To: <87zftanc6d.fsf@igalia.com> References: <877cgig2j7.fsf@gmail.com> <87zftanc6d.fsf@igalia.com> Date: Fri, 03 May 2024 20:08:13 +0200 Message-ID: <871q6ikbua.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.71 X-Spam-Score: -5.71 X-Migadu-Queue-Id: 7025477BB6 X-Migadu-Scanner: mx11.migadu.com X-TUID: 9ARpyK35EuLV Hi Andy, Thanks for the explanations. On mar., 30 avril 2024 at 16:43, Andy Wingo wrote: >> The first question is: is it still correct? Because this module had >> been implemented before many Guile compiler improvements. > > No, the comment is incorrect. The type check on whatever accessor is > called first (unspecified in scheme; probably we should just bite the > bullet and do predictable left-to-right semantics, as racket does) will > dominate the rest and eliminate those checks. The assert-type is > unnecessary. Good to know. > To see this, do ,optimize-cps at the repl, and count the number of > e.g. struct? checks with and without the assert-vlist. There is only > one, either way. Hum, I am not sure to understand how to use ,optimize-cps at the repl. Naively, I get: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,use(ice-9 vlist) scheme@(guile-user)> ,optimize-cps (vlist-cons 'foo vlist-null) L0: ; at :1= 02:14 v0 :=3D self L1(...) L1: receive() v1 :=3D current-module() ; mod While executing meta-= command: In procedure +: Wrong type argument in position 1: #f --8<---------------cut here---------------end--------------->8--- Since =E2=80=99,help compile=E2=80=99 reads, ,optimize-cps EXP [,optx] - Run the CPS optimizer on a piece of= code and print the result. I assume that I do not feed with the correct expression EXP. What would be the invocation? > (A type check is a heap-object? check, then struct?, > then get the vtable, then check against the global variable . > All of these duplicates get eliminated.) Ah yeah, it makes sense. :-) Cheers, simon