guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Semantics of circular imports


From: Maxime Devos
Subject: Re: Semantics of circular imports
Date: Sun, 27 Mar 2022 16:19:57 +0200
User-agent: Evolution 3.38.3-1

Philip McGrath schreef op zo 27-03-2022 om 10:12 [-0400]:
> Oh, wow. I definitely had not realized that, *even inside a
> declarative 
> module*, a reference to a variable with no statically visible
> definition 
> would semantically be a dynamic lookup in a mutable environment at 
> runtime (rather than a compile-time error), though I do see now that 
> `info guile declarative` does indeed say that marking a module as 
> declarative "applies only to the subset of top-level definitions that
> are themselves declarative: those that are defined within the 
> compilation unit, and not assigned (‘set!’) or redefined within the 
> compilation unit."
> 
> Does this mean that Guile treats all imported bindings as non-
> declarative?
> 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).

To my understanding, declarative modules are orthogonal to circular
imports.  All declarative modules do, is telling the Guile compiler
that ‘yes, inlining is fine, I won't change the value of these top-
level variables’.

Declarativity does not change the module variable lookup system and
module loading system, it only changes the set of optimisations.

Greetings,
Maxime.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]