We present a transformation based denotational semantics for a call-by-value language with first-class, hierarchical and recursive modules. We use the notion of modules as proposed in [1]. They merge dynamic data structures with aspects of modularisation and name binding in functional programming languages. Modules are first-class values which capture recursive definitions, lexical scoping, hierarchical structuring of programs and dynamically typed data structures in a single construction. We define a call-by-value language ModLang and explain what problems occur in combining nested, recursive and first-class modules. We then show how to solve these problems by defining a dependency analysis to determine the evaluation order, enabling a transformation into an intermediate representation. Finally, we present a denotational call-by-value semantics.
展开▼