We are going to introduce modules into BitC. This is a provisional
description in case we missed something.

1. Every compilation unit is a module. The revised definition of a
compilation unit is:

   (bitc-version "version-string")
   (module ident ;; purely for convenience of identification
      def
      def
      ...
      def)

The BitC compiler will impose the restriction that all values bound at
top level in a module are deep frozen unless BOTH of the following are
true:

  A) The module contains a declaration that it is stateful:

     (module stateful-module
       (declare (module-properties stateful))
       def
       ...
       def)

  B) A command line option --stateful is supplied to the compiler
     enabling stateful module compilation.


2. No symbol is implicitly exported from a module. Every exported symbol
must be declared by

   (export ident ... ident)

3. Modules are imported by the IMPORT or STATEFUL-IMPORT forms:

   (import local-name module-name)
   (stateful-import local-name module-name)

where the details of "module-name" still need to be worked out, but the
most likely answer is some identifier that can be mapped to a file
containing a unit of compilation.

Note that a module's state is imported into a program image exactly
once. It is necessary to specify this exactly because modules may be
stateful.

The effect of STATEFUL-IMPORT is to cause the identifier LOCAL-NAME to
name an environment containing all of the symbols exported by the module
named by MODULE-NAME.

The effect of IMPORT is to cause the identifier LOCAL-NAME to name an
environment containing all of the deep frozen symbols exported by the
module named by MODULE-NAME.

That is, if module X exports a deep frozen symbol a:int, the effect of

  (import localNameForX X)

is that the symbol

  localNameForX::a

is now an alias for the symbol 'a' in module X.


shap

_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to