Skip to main navigation Skip to search Skip to main content

Modular Compilers Based on Monad Transformers

  • William L. Harrison
  • , Samuel N. Kamin

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

13 Scopus citations

Abstract

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 re ect 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 $-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.
Original languageEnglish
Title of host publicationProceedings of the 1998 International Conference on Computer Languages
PublisherIEEE Computer Society Press
Pages122-131
Number of pages10
ISBN (Print)0-780-35005-7, 0-8186-8454-2, 0-8186-8456-9
DOIs
StatePublished - 1998
Externally publishedYes

Fingerprint

Dive into the research topics of 'Modular Compilers Based on Monad Transformers'. Together they form a unique fingerprint.

Cite this