chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] (load ...)


From: Peter Keller
Subject: Re: [Chicken-hackers] (load ...)
Date: Thu, 7 Jun 2007 13:16:23 -0500
User-agent: Mutt/1.4.2.1i

On Thu, Jun 07, 2007 at 04:54:34PM +0000, Alejandro Forero Cuervo wrote:
> > So, in the case of compiling two files, one having (declare (uses x))
> > and the other (declare (unit x)) and compiling with two separate
> > commands (as in the manual), how does Chicken share the knoweldge about
> > what functions to call in unit x?
> > 
> > like:
> > 
> > csc -c foo.scm
> > csc -c bar.scm
> > csc bar.o scm.o -o a.out 
> > 
> > How does the user of x know the name of the function in unix to invoke to
> > the linker gets it right?
> 
> I must admit I fail to understand your question.
>
> I also fail to see any relation between this and your previous
> question.  In this example you are not using load at all, AFAICT.  In
> this case both files get compiled and linked in a.out.

Ah, let me explain the relationship.

1. If (load ...) is determined by the compiler to be loading a real file
from the file system, is the file then actually brought in (lexically
analyzed, etc, etc, etc) and compiled as a unit or is it only interpreted.

2. Then knowing that the (declare ...) syntax allows for separate compilation:
        A) How did the C linker know that a scheme function defined in
                file A can be called by a function in file B? Basically,
                is there an undefined reference to a C continuation
                created by a function in B which gets linked by the
                C linker to a defined C continuation in A?  Or, does
                the compiler emit a function linkage table from scheme
                names to C function pointers which is used at runtime
                time instead of link time?

        B) If (load ...) actually *did* compile the codes, then did it use the
                same mechanism?

Thank you.

-pete




reply via email to

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