chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] top level environment hygiene in Chicken source


From: John Cowan
Subject: Re: [Chicken-hackers] top level environment hygiene in Chicken source
Date: Tue, 29 Dec 2009 16:57:59 -0500
User-agent: Mutt/1.5.13 (2006-08-11)

Thomas Bushnell BSG scripsit:

> Using "usual-integrations" as documented doesn't promise any particular
> inlining or optimization.  Is it being implicitly assumed that
> usual-integrations on library.scm will do the right thing?  How is this
> checked?  Isn't it kind of brittle to have that sort of remote
> dependency, in which the correctness of library.scm depends on which
> procedures happen to have inline or other definitions?

Runtime.c, library.scm, and the compiler are closely coupled and
constitute the trusted core of the Chicken system.

Thus since it is known that the compiler will inline calls to 'cdr'
(unless 'trusted-integrations' is turned off, which is not the case when
library.scm is being compiled), it is safe to not protect the value of
'cdr' when compiling 'cdddr', as the compiled code will contain no
references to the global value cell of the symbol 'cdr'.

Per contra, the mere act of declaring 'list->string' as a local variable
prevents calls to it from being inlined, as the compiler does not do
the relevant flavor of constant propagation.

If some of these fundamental decisions were revisited, changes would
have to be consistently carried through all three components.

-- 
While staying with the Asonu, I met a man from      John Cowan
the Candensian plane, which is very much like       address@hidden
ours, only more of it consists of Toronto.          http://www.ccil.org/~cowan
        --Ursula K. Le Guin, Changing Planes




reply via email to

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