This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: pssyntax.ss and module system


Jost Boekemeier <jostobfe@mango2.zrz.tu-berlin.de> writes:

> Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:
> 
> > Well, then you should read it again, because separate compilation is
> > one of the features which this module system is designed to support.
> > It's even mentioned explicitly in the abstract.
> 
> Yes, I know that.  But I don't think this is what ML' people mean
> when they talk about separate compilation:

OK, instead of writing "this module system has the problem that it
doesn't support separate compilation", could you then please write "I
think ML people mean something different with separate compilation"
and explain the difference?

> In section 5.1 they say that "it is necessary to first load or visit
> m1's object file" to compile m2."

This is only smart, not necessary.  "Necessary" is taken out of
context here.  The more complete context is:

"If a module m2 imports from a module m1, the compiler must have the
interface for m1 in order to compile m2.  When a source file
containing m1 is compiled, the resulting object file contains the
compiled code for m1, its interface, and compiled code for any macro
transformers defined by m1.  Before compiling m2, it is necessary to
first load or visit m1's object file to install its interface and
transformers."

The compiler, in principle, only needs the interface (which is stated
in the first sentence) and the transformers.  Then there might occur
some complications related to name substitution.  But these
complications are dependent on exactly how one sets up the framework
for separate compilation.

Nevertheless, it is good that you pointout this, because there might
be some pitfalls here.

> I think this is necessary because all module connections are rewritten
> into a low-level import primitive and their import primitive refers to
> the module itself, not to an abstract interface as in MZ Scheme for
> example.

But the module in itself is an abstract interface.  Everything about
modules can be resolved at compilation time.

> In "C" the compiler examines interfaces, not object files, no?

Some C compilers precompile the headers.  I think we should compare to
that situation.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]