[R6RS] Modules, a second question

Matthew Flatt mflatt
Tue Sep 28 09:03:23 EDT 2004


At Tue, 28 Sep 2004 14:16:50 +0200, Manuel Serrano wrote:
> When a module M1 "requires" (or imports) a module M2. As far as I understand
> M2 is supposed to be executed before M1. Now imagine that M1 requires
> M2 but actually refers to no variables of M2. Is the execution of M2 still
> required. 

Yes.

> If the answer is yes, then my second question is: don't you
> think that we need a mean for importing without executing a module.

I'm not sure what it would mean.

> Otherwise, I'm afraid that a single application made of one short module
> such as:
> 
> (module foo r6rs
>  (display "Hello world"))
> 
> will actually initialize the entire r6rs Scheme run time system. 

Well, that's the intent...

> The bad consequence is that it will be hard for a compiler to deliver
> applications that won't be linked against the whole r6rs runtime
> system.  It is likely to be very hard to produce small Scheme
> executables...

I don't see why. I would imagine that nothing about initializing r6rs
is actually observable if you don't use functions, so the compiler
could eliminate lots of dead code.

But I'm no expert on compilers, so I'll let others take up that point.

Matthew



More information about the R6RS mailing list