Semantic Lego

Denotational semantics (Sch86) is a powerful framework for describing programming languages; however, its descriptions lack modularity: conceptually independent language features influence each others' semantics. We address this problem by presenting a theory of modular denotational semantics. Following Mosses (Mos92), we divide a semantics into two parts, a computation ADT and a language ADT (abstract data type). The computation ADT represents the basic semantic structure of the language. The language ADT represents the actual language constructs, as described by a grammar. We define the language ADT using the computation ADT; in fact, language constructs are polymorphic over many different computation ADTs. Following Moggi (Mog89a), we build the computation ADT from composable parts, using monads and monad transformers. These techniques allow us to build many different computation ADTs, and, since our language constructs are polymorphic, many different language semantics. We automate these ideas in scSEMANTIC LEGO (SL), a modular language construction set written in Scheme. SL generates interpreters automatically from composable parts and is a useful tool for programming language design.

[1]  J. Michael Spivey,et al.  A Functional Theory of Exceptions , 1990, Sci. Comput. Program..

[2]  Pietro Cenciarelli,et al.  A Syntactic Approach to Modularity in Denotational Semantics , 1993 .

[3]  Luca Cardelli,et al.  Typeful Programming , 1989, Formal Description of Programming Concepts.

[4]  Paul Hudak,et al.  Monad transformers and modular interpreters , 1995, POPL '95.

[5]  Benjamin C. Pierce,et al.  Basic category theory for computer scientists , 1991, Foundations of computing.

[6]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[7]  M. Barr,et al.  Toposes, Triples and Theories , 1984 .

[8]  Peter D. Mosses,et al.  Denotational semantics , 1995, LICS 1995.

[9]  Gregor Kiczales,et al.  Towards a new model of abstraction in software engineering , 1991, Proceedings 1991 International Workshop on Object Orientation in Operating Systems.

[10]  Michael Barr,et al.  Category theory for computing science , 1995, Prentice Hall International Series in Computer Science.

[11]  Philip Wadler,et al.  Monads for functional programming , 1995, NATO ASI PDC.

[12]  Uday S. Reddy,et al.  Imperative functional programming , 1996, CSUR.

[13]  Andrzej Filinski,et al.  Representing monads , 1994, POPL '94.

[14]  Matthias Felleisen,et al.  The Denotational Specifications of Complex Languages , 2005 .

[15]  Rod M. Burstall,et al.  Computational category theory , 1988, Prentice Hall International Series in Computer Science.

[16]  Joseph A. Goguen,et al.  Initial Algebra Semantics and Continuous Algebras , 1977, J. ACM.

[17]  Guy L. Steele,et al.  Building interpreters by composing monads , 1994, POPL '94.

[18]  Peter Buneman,et al.  Theoretical Aspects of Object-Oriented Programming , 1994 .

[19]  Philip Wadler,et al.  The essence of functional programming , 1992, POPL '92.

[20]  Eugenio Moggi A Modular Approach to Denotational Semantics , 1991, Category Theory and Computer Science.

[21]  Philip Wadler,et al.  Theorems for free! , 1989, FPCA.

[22]  Robert D. Tennent,et al.  Semantics of programming languages , 1991, Prentice Hall International Series in Computer Science.

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

[24]  S. Shelah,et al.  Annals of Pure and Applied Logic , 1991 .

[25]  Daniel G. Bobrow,et al.  Book review: The Art of the MetaObject Protocol By Gregor Kiczales, Jim des Rivieres, Daniel G. and Bobrow(MIT Press, 1991) , 1991, SGAR.

[26]  Harold Abelson,et al.  The LISP experience , 1988 .

[27]  Philip Wadler,et al.  Combining Monads , 1992 .