From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GHVOAfh6QGKmAgAAgWs5BA (envelope-from ) for ; Sun, 27 Mar 2022 16:55:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id kERfOvd6QGJvKgAA9RJhRA (envelope-from ) for ; Sun, 27 Mar 2022 16:55:51 +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 C38DC1151F for ; Sun, 27 Mar 2022 16:55:51 +0200 (CEST) Received: from localhost ([::1]:57354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYUJ4-000352-TY for larch@yhetil.org; Sun, 27 Mar 2022 10:55:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYUIm-00034l-Fu for guix-devel@gnu.org; Sun, 27 Mar 2022 10:55:32 -0400 Received: from [2a02:1800:110:4::f00:18] (port=40026 helo=michel.telenet-ops.be) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYUIk-0000q3-H2 for guix-devel@gnu.org; Sun, 27 Mar 2022 10:55:32 -0400 Received: from [172.20.10.23] ([188.188.29.207]) by michel.telenet-ops.be with bizsmtp id BSvS2700Y4U7BGC06SvTCL; Sun, 27 Mar 2022 16:55:27 +0200 Message-ID: <2e85e1dba0f4dbb52898d5302843fbf9040fdda9.camel@telenet.be> Subject: Re: Semantics of circular imports From: Maxime Devos To: Philip McGrath , Ekaitz Zarraga , Ricardo Wurmus , guix-devel@gnu.org Date: Sun, 27 Mar 2022 16:55:21 +0200 In-Reply-To: <3493949.dX3coAEF3O@bastet> References: <2067ba1e606855eace261fd0b0ae9721b369bbd5.camel@telenet.be> <753ba5897ed397b5e95175cd139137975245945b.camel@telenet.be> <6012789.Rgyoke53jH@bastet> <3493949.dX3coAEF3O@bastet> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-8HSCxtgw8v3cZSVoGdud" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1648392927; bh=9nERjR3XQF2vS4NXmXDZ82CRYknSzK6ICHqiX4EFmho=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=WutlSH3gEctILq6FHiykIKPCJ4LpRCMPbvVhQxKA0/bNIx4+N+tc9+shNBFaxCy5v wlob4xzHko9DYkhUD7CoMuQ0lmj7H9FosCrffGAOm0g054VExph++GowjX8t8EUwWZ E1gNKD7W1t2sHMmLddxjPMaBSXjiKoL7wpEMuJaKtF/wrXi36yLMtrZuanEwW1Z4gn gPhekwF/zw7SWb9V8hrcetxqPorcYDtP5g7fZXLIPuUe9xHXg0IwdtSCUxHuFoDHhe soulUw7xjDl6f+KwCcv+0ZmsdWaRM0X4hPurlYhDgeJe8Nwof8yems0qSf0ZbP4ZYB kDevbG8QyyYnQ== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:1800:110:4::f00:18 (failed) Received-SPF: pass client-ip=2a02:1800:110:4::f00:18; envelope-from=maximedevos@telenet.be; helo=michel.telenet-ops.be X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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_LOW=-0.7, 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: Liliana Marie Prikler 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=1648392951; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=9nERjR3XQF2vS4NXmXDZ82CRYknSzK6ICHqiX4EFmho=; b=TBEw6iCxBbupwPxADQBcRvvwo/N7Pu+SDrqS6qioDD+R8m7ZfYdKAgoK62uBc9/3+F38Ql hU4minsv+P08ksKSt4/YsmnjqHDRpNK4Beg4GEHZ9BT9OI8FDttY4QcbekB0n0DeJK3f9V TbINyAtvfgxZ1vxIHg0dgIvJOh9Fy0ex0JByHlNJrpNDk/hcGu0UVwFaMahxiMZ/zCkgqi mLWGFLjOo81Aig8sIS1VtJGJO3RO6S5s53vPlx6oQYUHYaE8HThfsNv8dVB0CvoLCIT2Sk b24GgMctV2LURS6X8Ev3rOK5bhJrDAJirksAjQAAIQSkEyIJo64HQn9YGSWL6A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648392951; a=rsa-sha256; cv=none; b=Cdyoocqf6ZvJgA9yvdWlTXHQNVhH6JKzCLLarZsrtNj6I+SFr1Qx4Z9nptiDRXx52q/+Ey GRRY4NnK0ta4Z01AZJYs4+r8ZE+RQd/U1t9HNVMZ5K5duOVKsRLCbgR5zXYYQ6nCEy5c4e 4wGicR8jO2Wfrqfa+eMtAJ1A1bhiLwY0B51jhNdpyyb4OIIApPfajSYhNfBO4SOc1tyf1X Md/3TFz/OpB68fUeGfsX9nvElDZDOyKrBpI4KIi4xwsmrAatcmiOc6LccSZsPwdJ1w/0jX W4s4qWZ9XPuyjKg0MrGVs1LDnWTmE2L6wr1dSgW+pFldAYiApJ3d6ikVP0oVOA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=WutlSH3g; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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: 2.73 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=WutlSH3g; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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: C38DC1151F X-Spam-Score: 2.73 X-Migadu-Scanner: scn0.migadu.com X-TUID: nn42oW5Bp8kJ --=-8HSCxtgw8v3cZSVoGdud Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Philip McGrath schreef op zo 27-03-2022 om 10:12 [-0400]: > In the context of Racket or R6RS modules, where the semantics are=20 > essentially those of `letrec*`, I'm used to distinguishing "unbound" > variables from "undefined" variables, two types of errors, though > informally "defined" is often used more loosely:=20 Guile also distinguished them, though possibly in a different way, and terminology is inconsistent. >=20 > =C2=A0 1. Every variable reference must refer to a lexically visible > binding, or it is an "unbound" variable error. Inherently, this > can *always* be=C2=A0detected statically at compile time. This is different in Guile. If a variable reference 'foo' is not a lexical variable, then Guile assumes it is a global variable -- it doesn't check if the name of the global variable reference actually belongs to an imported module, this only happens at runtime.=20 Apparently Guile is a bit lazier than Racket. >=20 > =C2=A0 2. A variable may not be accessed until it has been initialized.( > More precisely, we could discuss a variable's "location", which > I see is part of Guile's model.) This is the essence of the > `letrec`/`letrec*` restriction: while the "fixing letrec" > papers[4][5] show that useful static analysis can be done, this > is fundamentally a dynamic property. Violating the restriction > is an "undefined" variable error at runtime. I don't know how Guile handles letrec/letrec*. However, Guile has undefined(uninitialised? unbound? Guile has inconsistent terminology here) variables: (define foo) ; no value foo ; I thought this would raise an "Unbound variable: ..." error but appar= ently not? A bug? Looks like it returns *unspecified* instead ... (variable-ref (make-undefined-variable)) ; -> Unbound variable: ... (define f (make-variable #f)) (variable-unset! f) (variable-ref f) ; --> Unbound variable: #> (variable-ref (make-variable #f)) ; this variable has no name, so in a sens= e, it is not =E2=80=98bound=E2=80=99, yet it has a value Greetings, Maxime. --=-8HSCxtgw8v3cZSVoGdud Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkB62RccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ignAP9Jefddgqaxja9JMPXd99phIPN9 h2pG2cCM3nGVHWhn5gD+LdmqSnLIx1is4KOfQP1p2kmsbKXQr7LZSnlmKZ2/gg4= =pr2Q -----END PGP SIGNATURE----- --=-8HSCxtgw8v3cZSVoGdud--