Title :
Modular compilers based on monad transformers
Author :
Harrison, William L. ; Kamin, Samuel N.
Author_Institution :
Dept. of Comput. Sci., Illinois Univ., Urbana, IL, USA
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 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 λ 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
Keywords :
computational linguistics; formal specification; program compilers; software reusability; λ expressions; CBN evaluation; CBV; dynamic scoping; extensibility; imperative features; lambda expressions; language constructs; language specification; machine-like stores; mix and match method; modular compilers; modularity; monad structured interpreter; monad transformers; monadic semantics; monadic style; recursive procedures; semantic expressions; source language; Computer languages; Computer science; Data structures; Equations; Modular construction; Program processors; Transformers;
Conference_Titel :
Computer Languages, 1998. Proceedings. 1998 International Conference on
Conference_Location :
Chicago, IL
Print_ISBN :
0-8186-8454-2
DOI :
10.1109/ICCL.1998.674163