Social Sciences · Sociology and Political Science
Modular Executable Language Specifications in Haskell
See on the mapAbstract
Abstract We propose a framework for specification of programming language semantics, abstract andconcrete syntax, and lexical structure. The framework is based on Modular Monadic Semantics and allows independent specification of various language features. Features such as arithmetics,conditionals, exceptions, state and nondeterminism can be freely combined into working interpreters, facilitating experiments in language design. A prototype implementation of this systemin Haskell is described and possibilities for more sophisticated interpreter generator are outlined. 1 Introduction Denotational Semantics is a widely used method for formal specification of programming language semantics. It is a complete semantics, which permits proving all relevant program properties, and also enables automatic generation of language interpreters from language specifications. One of the problems which hinder wider use of Denotational Semantics is its lack of modularity. Within last decade an approach called Modular Monadic Semantics was proposed as a means to structure Denotational Semantics and make it more usable. This approach has theoretical advantages in systematic treatment of language features ([14]), but is also of great value for generating more efficient interpreters from specifications ([12], [4]).