Modular Denotational Semantics for Compiler Construction

We show the benefits of applying modular monadic semantics to compiler construction. Modular monadic semantics allows us to define a language with a rich set of features from reusable building blocks, and use program transformation and equational reasoning to improve code. Compared to denotational semantics, reasoning in monadic style offers the added benefits of highly modularized proofs and more widely applicable results. To demonstrate, we present an axiomatization of environments, and use it to prove the correctness of a well-known compilation technique. The monadic approach also facilitates generating code in various target languages with different sets of built-in features.

[1]  Compiling actions by partial evaluation , 1993, FPCA '93.

[2]  Paul Hudak,et al.  Realistic compilation by program transformation (detailed summary) , 1989, POPL '89.

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

[4]  Erik Meijer,et al.  More on Advice on Structuring Compilers and Proving them Correct , 1979, Theor. Comput. Sci..

[5]  Deryck Forsyth Brown,et al.  Actress: An Action Semantics Directed Compiler Generator , 1992, CC.

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

[7]  Philip Wadler,et al.  Comprehending monads , 1990, LISP and Functional Programming.

[8]  Andrew W. Appel,et al.  Continuation-passing, closure-passing style , 1989, POPL '89.

[9]  Mitchell Wand A semantic prototyping system , 1984, SIGPLAN '84.

[10]  Simon L. Peyton Jones,et al.  Imperative functional programming , 1993, POPL '93.

[11]  Peter Lee Realistic compiler generation , 1989, Foundations of Computing Series.

[12]  Erik Ruf,et al.  Automatic Online Partial Evaluation , 1991, FPCA.

[13]  Jozef Gruska Foundations of Computing , 1997 .

[14]  Anders Bondorf,et al.  Automatic Autoprojection of Recursive Equations with Global Variables and Abstract Data Types , 1991, Sci. Comput. Program..

[15]  Philip Wadler,et al.  Glasgow Workshop on Functional Programming , 1992 .

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

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

[18]  M. Felleisen,et al.  Reasoning about programs in continuation-passing style , 1993 .

[19]  John Launchbury,et al.  Functional Programming, Glasgow 1992 , 1993, Workshops in Computing.

[20]  Peter Ørbæk OASIS: An Optimizing Action-Based Compiler Generator , 1994, CC.

[21]  O. Danvy,et al.  Compiling Monads ∗ , 1991 .

[22]  Lawrence C. Paulson A semantics-directed compiler generator , 1982, POPL '82.

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

[24]  Olivier Danvy,et al.  A generic account of continuation-passing styles , 1994, POPL '94.

[25]  William L. Scherlis,et al.  Compilers and staging transformations , 1986, POPL '86.

[26]  Neil D. Jones,et al.  Mix: A self-applicable partial evaluator for experiments in compiler generation , 1989, LISP Symb. Comput..

[27]  Paul Hudak,et al.  Mutable abstract datatypes -or- how to have your state and mange it too , 1992 .

[28]  Peter D. Mosses,et al.  A Basic Abstract Semantic Algebra , 1984, Semantics of Data Types.

[29]  Jens Palsberg A Provably Correct Compiler Generator , 1992 .

[30]  Erik Meijer More Advice on Proving a Compiler Correct: Improve a Correct Compiler , 1991, Declarative Programming.

[31]  Dominique Clément,et al.  A simple applicative language: mini-ML , 1986, LFP '86.

[32]  Mitchell Wand,et al.  A Short Proof of the Lexical Addressing Algorithm , 1990, Inf. Process. Lett..

[33]  Paul Hudak,et al.  Realistic Compilation by Program Transformation. , 1989 .

[34]  Joseph E. Stoy,et al.  Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory , 1981 .

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