Mark Shields and Simon Peyton Jones. Submitted to the Ninth International Conference on Foundations of Object-Oriented Languages(FOOL 9), Portland, Oregon. 20 pages. Oct 2001.
In this paper we refine Haskell's core language to support first-class modules with many of the features of ML-style modules. Our proposal cleanly encodes signatures, structures and functors with the appropriate type abstraction and type sharing, and supports recursive modules. All of these features work across compilation units, and interact harmoniously with Haskell's class system. Coupled with support for staged computation, we believe our proposal would be an elegant approach to run-time dynamic linking of structured code.
I am very fond of the idea of first-class modules. They allow you to build cool software abstractions. They support a more dynamic view of programs, not at the typing level (cf. static vs. dynamic typing), but at the module level, which is a bit more interesting since it captures the structure of a software system.
All this is relatated to things like reflection, AOP, and indeed (eventually at least) language neutral components. Obviously the first steps must be taken within the scope of specific languages.
My Ada roots make me a bit cautious though. Shouldn't the structure of a system, as defined by modules, by static? Isn't this an important feature for readability, and performance?
I am more concerned with the former, as the latter may not really be a show stopper.
Maybe the distinction between static attrbiutes (like types) and dynamic values (variables) is essential for the way we think and reason about programs, and modules are just another example?
I hope more work on this subject will help decide these questions.
Posted to Software-Eng by Ehud Lamm on 12/25/01; 2:25:58 PM