Author_Institution :
NEC Res. Inst., Princeton, NJ, USA
Abstract :
Providing programmers the ability to construct meaningful abstractions to help manage complexity is a serious language design issue. Many languages define a module system that can be used to specify distinct namespaces, and build user-defined data abstractions; however, few languages support dynamic modules, i.e., modules which are true first-class objects. We define a module semantics for a dialect of Scheme called Rascal. Modules are defined in terms of reified environments, and are first-class objects which may be dynamically created, freely assigned, used as arguments to procedures, etc. If defined naively, however, implementing modules using environments can entail the capture of unwanted bindings, leading to potentially severe violations of lexical abstraction and locality. We address these concerns by giving users great flexibility to manipulate environments, and to constrain the extent and scope of the environment reification process. We argue that the techniques and operators developed define a cohesive and semantically sound basis for building large-scale modular systems in dynamically-typed higher-order languages
Keywords :
algorithmic languages; high level languages; type theory; Rascal; Scheme; abstract data types; algorithmic language; complexity; dynamic modules; dynamically-typed higher-order languages; higher-order languages; language design; large-scale modular system building; lexical abstraction; module system; namespaces; unwanted bindings; user-defined data abstractions; Environmental management; Large-scale systems; National electric code; Programming profession; Proposals;