[R6RS] Re: strawman module syntax

Michael Sperber sperber
Thu Jul 8 12:20:16 EDT 2004


>>>>> "Kent" == R Kent Dybvig <dyb at cs.indiana.edu> writes:

>>   To make a long story short: I think that module *interfaces*, not
>>   definitions should have globally unique meanings, and that the
>>   implementation for any given interface should be determined at
>>   compile/link time.  This would mirror the way cc/ld works, and I
>>   think it's the way to go.

Kent> I don't understand what you mean by "compile/link" time.  Do you mean to
Kent> say that compile and link time are the same?  

Sorry to be sloppy here---you need to resolve module dependencies at
least to some degree before compiling because of macros.  I still
expect there to be two separate phases in typical implementations.

Kent> In the cc/ld model, an interface (aka header file) includes whatever
Kent> the programmer likes, including macros, variable declarations, and even
Kent> function definitions.  It looks like you're restricting the interface to
Kent> names, which doesn't even give the compiler a chance to expand macros.
Kent> Correct?

Correct.  At least it does indicate which identifiers are bound to
macro transformers.

Kent> Also, how is the implementation actually determined?
Kent> Presumably, there could be more than one module that implements
Kent> the same interface or there's not much point in separating
Kent> interfaces from implementations.

There might be more than one, but not in any given application, so
every implementation is uniquely determined.

This is for leaving the door open for converting a module into a true
component after the fact.  Then, any number of methods might determine
the implementation---you may specify the entire link graph (as in
MzScheme's units), or group your modules into little piles with more
cohesion amonst each other than with the outside.  (Richard once wrote
on excellent paper on how such a module system could work.)  I don't
feel we're ready for that kind of system in R6RS, but I'd like to be
compatible in that directions.

Kent> From your syntax, I take it that an application cannot contain
Kent> any top-level forms other than config forms, so top-level
Kent> definitions and commands are out.  Correct?

Yes.

Kent> Where does the execution of an application start?

Presumably you specify an initial module to run.

Note that I'm not proposing to abolish the interactive top level.
Both MzScheme and Scheme 48 show how to get it back even in the
context of such a module system.

-- 
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla


More information about the R6RS mailing list