2002 · 24 citations · 9 references
ComputingComputer ScienceCompilersProgramming LanguagesSemanticsAbstract Syntax TreesCode GenerationCompiler ConstructionInterpreter DesignSyntax AnalysisType SystemsCompiler DesignDynamic ScopingInterpretersModular DesignMonadic SemanticsMonadsRecursive Functions
The monadic style of language specification has the advantages of modularity and extensibility: it is simple to add or change features in an interpreter to reflect modifications in the source language. It has proven difficult to extend the method to compilation. We demonstrate that by introducing machine-like stores (code and data) into the monadic semantics and then partially evaluating the resulting semantic expressions, we can achieve many of the same advantages for a compiler as for an interpreter. A number of language constructs and features are compiled: expressions, CBV and CBN evaluation of /spl lambda/ expressions, dynamic scoping, and various imperative features. The treatment of recursive procedures is outlined as well. The resulting method allows compilers to be constructed in a mix and match fashion just as in a monad structured interpreter.
9
Notions of computation and monads
Eugenio Moggi · Information and Computation · 1991 · 1.7K citations
The essence of functional programming
Philip Wadler · 1992 · 676 citations · Full text
Monad transformers and modular interpreters
Sheng Liang, Paul Hudak, Mark P. Jones · 1995 · 504 citations · Full text
Type-directed partial evaluation
Olivier Danvy · 1996 · 169 citations · Full text