From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wKR0A+joQ2L4ZwAAgWs5BA (envelope-from ) for ; Wed, 30 Mar 2022 07:21:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iA7mAOjoQ2L3kgAA9RJhRA (envelope-from ) for ; Wed, 30 Mar 2022 07:21:44 +0200 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 B923B238B5 for ; Wed, 30 Mar 2022 07:21:43 +0200 (CEST) Received: from localhost ([::1]:45792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZQIn-0003Uh-QK for larch@yhetil.org; Wed, 30 Mar 2022 00:51:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZQID-0003U1-NG for guix-devel@gnu.org; Wed, 30 Mar 2022 00:50:49 -0400 Received: from [2607:f8b0:4864:20::835] (port=37485 helo=mail-qt1-x835.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nZQIB-0004ri-Vd for guix-devel@gnu.org; Wed, 30 Mar 2022 00:50:49 -0400 Received: by mail-qt1-x835.google.com with SMTP id t19so17182609qtc.4 for ; Tue, 29 Mar 2022 21:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=/FyYfnwZ7vUb9y0bRSSkYz9csdEqCS7745cp63/RZYU=; b=bHnxsrDLvh2K6yelDbRHyYz5ASGo69x3EyTFHRgF7NqSW7Z+d2wdcOMcYx/pnEQYG/ wkwTAsbX+i5vTampWybbDwb6lhlmZEsZzo2dXity/zBr8lkOMv0nkNrrBKUaYIqI02fe b1Gm4dChI2ZprDWXXZIB6P7Yba2Ys//xNvV2zB22NBNOy5KaplK8H8KZJIo44uLq/My1 3hqXh+BVr1t25ut+U0XxgjrEKm1yZOj4tCnnVqHjzTG5tFHjiyF33Vu23R55YamdDFEI ycKXn0NuiwB0gi8+SwXTtLmRA/HJRXGNxNqrt6YTafuZ8x0+PEoPllNVx0sFH76PD3H9 4Iog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=/FyYfnwZ7vUb9y0bRSSkYz9csdEqCS7745cp63/RZYU=; b=N93O+K33Qe32/fHcYRd69nKapk9smRRk86GFblb8siI0hFoGSnqGjdJvvosnM5VS6r xIW3sUvqvCspo+3XTpCWN12ttrk/hGM81v+POr2Dt7+owGffGuzMEHYBxDrrmMhZ6uGy ByUDVB/+IxjIEPhadG3wu1esqCdBMjsQXWFUkzCMg0C30q/VI7AuvVMAxALsHN1IogkT 4w8zzCIJl4yI3GPgkaZf7kJPAn0ciZeXw3KTnZ8OvkeX2J4/ty1uVB7vQYA1HawWZtHo qCc8U+GFaqhHgONGEzMTG5FmJxCUrf1DdEAHwkNw7upvkAx9IzYAuxD4hWU0fknJx933 Nohg== X-Gm-Message-State: AOAM5307sdhIUHU1r/30SxQCfbIWoTuua/jiVOllWT9juDGIyfWo2TCv 40b9cOWfxQiEG9+wT57FzzyIzJFVVR4= X-Google-Smtp-Source: ABdhPJy2bsZgUq030YHVGc8dyC3Ep3Jj2MSvHFEIz2h4clj5w7JmwD/34zvxwLTDaF4ATJHNcf1qYg== X-Received: by 2002:ac8:4048:0:b0:2e1:a800:2b36 with SMTP id j8-20020ac84048000000b002e1a8002b36mr31193061qtl.396.1648615846819; Tue, 29 Mar 2022 21:50:46 -0700 (PDT) Received: from hurd (dsl-150-248.b2b2c.ca. [66.158.150.248]) by smtp.gmail.com with ESMTPSA id 11-20020ac8590b000000b002e1e5c5c866sm17511028qty.42.2022.03.29.21.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Mar 2022 21:50:46 -0700 (PDT) From: Maxim Cournoyer To: Zhu Zihao Subject: Re: Semantics of circular imports References: <2067ba1e606855eace261fd0b0ae9721b369bbd5.camel@telenet.be> <753ba5897ed397b5e95175cd139137975245945b.camel@telenet.be> <6012789.Rgyoke53jH@bastet> <3493949.dX3coAEF3O@bastet> <86ilryr8wl.fsf@163.com> Date: Wed, 30 Mar 2022 00:50:45 -0400 In-Reply-To: <86ilryr8wl.fsf@163.com> (Zhu Zihao's message of "Mon, 28 Mar 2022 12:24:26 +0800") Message-ID: <87bkxoujq2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::835 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x835.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Ricardo Wurmus , Liliana Marie Prikler , guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648617703; 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=/FyYfnwZ7vUb9y0bRSSkYz9csdEqCS7745cp63/RZYU=; b=bSXQaFAL2VQ7PfOJboYhTFpZT/AUVq/jSmOyUdjLUtJe2HLw4G+LltOYPOD/vyXk4DHcgy Wk3uHDWXYNiLp3bRrTF1wAoEf9N2CaDsOlm0GUDfaerYcW7pD87wbHICeA/a9HrwrGiail /I1JomYZdblEZrvzDLbTh+DvuaOo0svRNw0AANPYIs2uFfsE7gN/K+atzgVL7UZ8Bso6Gh OytoXJdN+JRrwjP1XfaQ4llUA2lAKSYMmbz8Xb/Vtbsrgp7FIuLTgTTKzrUA2/xnj5GA7M 3wOEmcbTK0i0F0Yklw4ZsXWYFDn+qcqIn9oQC0/gVvrj7Q99xIzOdr+IZx47Xw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648617703; a=rsa-sha256; cv=none; b=OEzxeTSwYjlUomUAorEsvdaPE+vEY0tLRx24EX34R7qa6DcdCjL2Kx0X4+VX8Yp1rMWakE /yUwZ2EiYZfzTflRsKuhbDmNDXqIKeAcbnqkmnFCF3XGsnlhluqtATfnSSbGmrV2Zi3J2i /OAVl9891UcuY4e5F0Bz5dARgz1fZ9wlNP1441TQHNf570WRbbnavX11yZF281XfbYVkZE 3RWRTYAy43ORsFgbYF2c2j9P4jJs0wmgcFN53FmTrNqdN192eAW6iv+QKHPnWdooFiW91P /hjNl40ZSvTyHHpaJSv6UkMWxSBNr/+7QYcYY+elkQporKvV1rO3VIjJRVNWXQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=bHnxsrDL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Spam-Score: 5.33 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=bHnxsrDL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Queue-Id: B923B238B5 X-Spam-Score: 5.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: ybMzCuHlDrYf Hello, Zhu Zihao writes: > Philip McGrath writes: > >> Oh, wow. I definitely had not realized that, *even inside a declarative= =20 >> module*, a reference to a variable with no statically visible definition= =20 >> would semantically be a dynamic lookup in a mutable environment at=20 >> runtime (rather than a compile-time error), though I do see now that=20 >> `info guile declarative` does indeed say that marking a module as=20 >> declarative "applies only to the subset of top-level definitions that=20 >> are themselves declarative: those that are defined within the=20 >> compilation unit, and not assigned (=E2=80=98set!=E2=80=99) or redefined= within the=20 >> compilation unit." > > It depends on how you reference to it. If a variable is referenced in > the same module, it'll be inlined if it's small enough. > > If you reference it from another module, it'll do something like > module-ref instead (works like non-declarative binding) > >> This seems like a big barrier to cross-module inlining, though IIUC Guile >> currently doesn't do much of that by default (maybe for this reason). > > Guile 3.0.8 comes to rescue. It works by rewrite the `define-module` > call and attach the tree-il of some bindings on it. > > For details, read the blog post authored by Andy Wingo > > https://wingolog.org/archives/2021/05/13/cross-module-inlining-in-guile Thanks for the interesting read (nice writing from Wingo, as usual :-)). Maxim