Dynamic modules in higher-order languages

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.<<ETX>>

[1]  Mitchell Wand,et al.  The mystery of the tower revealed: a non-reflective description of the reflective tower , 1986, LFP '86.

[2]  Luca Cardelli,et al.  The Modula–3 type system , 1989, POPL '89.

[3]  Jean D. etc. Ichbiah Reference Manual for the ADA Programming Language , 1983 .

[4]  Butler W. Lampson,et al.  A Kernel Language for Abstract Data Types and Modules , 1984, Semantics of Data Types.

[5]  Craig Schaffert,et al.  Abstraction mechanisms in CLU , 1977, Commun. ACM.

[6]  John Lamping A unified system of parameterization for programming languages , 1988, LFP '88.

[7]  David Robson,et al.  Smalltalk-80: The Language and Its Implementation , 1983 .

[8]  Jonathan Rees,et al.  Macros that work , 1991, POPL '91.

[9]  Murray Hill An Implementation of Standard ML Modules , 1988 .

[10]  Jr. Guy L. Steele,et al.  Rabbit: A Compiler for Scheme , 1978 .

[11]  Gerald J. Sussman,et al.  Structure and interpretation of computer programs , 1985, Proceedings of the IEEE.

[12]  Jonathan A. Rees Another Module System for Scheme , 1993 .

[13]  Mitchell Wand,et al.  Reification: Reflection without metaphysics , 1984, LFP '84.

[14]  Mark A. Sheldon,et al.  Static dependent types for first class modules , 1990, LISP and Functional Programming.

[15]  Robin Milner,et al.  Definition of standard ML , 1990 .

[16]  Niklaus Wirth,et al.  Programming in Modula-2 , 1985, Texts and Monographs in Computer Science.

[17]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

[18]  Brian Cantwell Smith,et al.  The implementation of procedurally reflective languages , 1984, LFP '84.

[19]  Craig Chambers,et al.  Object, message, and performance: how they coexist in Self , 1992, Computer.

[20]  Mitchell Wand,et al.  Macro-by-example: Deriving syntactic transformations from their specifications , 1987, POPL '87.

[21]  Daniel P. Friedman,et al.  Quasi-static scoping: sharing variable bindings across multiple lexical scopes , 1993, POPL '93.

[22]  Mitchell Wand,et al.  The mystery of the tower revealed: A nonreflective description of the reflective tower , 1988, LISP Symb. Comput..

[23]  Pavel Curtis,et al.  A module system for scheme , 1990, LISP and Functional Programming.

[24]  Suresh Jagannathan,et al.  Environments as first class objects , 1987, POPL '87.

[25]  Suresh Jagannathan,et al.  A programming language supporting first-class parallel environments , 1989 .

[26]  D. H. Bartley,et al.  Revised4 report on the algorithmic language scheme , 1991, LIPO.