I was thinking about inlining, contant propagation, and that class of
optimizations recently. Wouldn't Guile's module system (specifically,
module-set!) interfere with doing these optimizations on module-level
bindings? If a binding is inlined, propagated, etcetera, and the
binding was set! by another module, then behavior could vary based on
whether the binding was optimized or not. (Bonus whine: Guile
currently does this with primitives like +) Off the top of my head,
R6RS makes all imported bindings immutable. How often are cross-module
set!s used in Guile? Maybe exported bindings could be made immutable
by default, and the module definition would explicitly name variables
that should be mutable by external code, so the compiler knows not to
optimize them. Correct me if I'm wrong here, I've never dealt with
this in practice so I'm just musing out loud.

Reply via email to