Abstract
This paper presents a modular and extensible style of language specification based on metacomputations. This style uses two monads to factor the static and dynamic parts of the specification, thereby staging the specification and achieving strong binding-time separation. Because metacomputations are defined in terms of monads, they can be constructed modularly and extensibly using monad transformers. A number of language constructs are specified: expressions, control-flow, imperative features, and block structure. Metacomputation-style specification lends itself to semantics-directed compilation, which we demonstrate by creating a modular compiler for a block-structured, imperative while language.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading (1986)
Appel, A.: Modern Compiler Implementation in ML. Cambridge University Press, New York (1998)
Appel, A.: Compiling with Continuations. Cambridge University Press, New York (1992)
Danvy, O.: Type-Directed Partial Evaluation. In: Proceedings of the ACM Conference on the Principles of Programming Languages (1996)
Danvy, O., Vestergaard, R.: Semantics-Based Compiling: A Case Study in Type-Directed Partial Evaluation. In: Eighth International Symposium on Programming Language Implementation and Logic Programming, pp. 182–197 (1996)
Davies, R., Pfenning, F.: A Modal Analysis of Staged Computation. In: Proceedings of the ACM Conference on the Principles of Programming Languages (1996)
Espinosa, D.: ”Semantic Lego”, Doctoral Dissertation, Columbia University (1995)
Harrison, W., Kamin, S.: Modular Compilers Based on Monad Transformers. In: Proceedings of the IEEE International Conference on Programming Languages, pp. 122–131 (1998)
Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs (1993)
Jorring, U., Scherlis, W.: Compilers and Staging Transformations. In: Proceedings of the ACM Conference on the Principles of Programming Languages (1986)
Lee, P.: Realistic Compiler Generation. MIT Press, Cambridge (1989)
Liang, S.: A Modular Semantics for Compiler Generation, Yale University Department of Computer Science Technical Report TR-1067 (February 1995)
Liang, S., Hudak, P., Jones, M.: Monad Transformers and Modular Interpreters. In: Proceedings of the ACM Conference on the Principles of Programming Languages (1995)
Liang, S.: Modular Monadic Semantics and Compilation, Doctoral Thesis, Yale University (1997)
Mogensen, T.: Separating Binding Times in Language Specifications. In: Proceedings of the ACM Conference on Functional Programming and Computer Architecture, pp. 12–25 (1989)
Moggi, E.: Notions of Computation and Monads. Information and Computation 93(1), 55–92 (1991)
Mosses, P.: Action Semantics. Cambridge University Press, Cambridge (1992)
Nielson, H., Nielson, F.: Code Generation from two-level denotational metalanguages. In: Ganzinger, H., Jones, N.D. (eds.) Programs as Data Objects. LNCS, vol. 217. Springer, Heidelberg (1986)
Nielson, H., Nielson, F.: Automatic Binding Time Analysis for a Typed λ- calculus. Science of Computer Programming 10(2), 139–176 (1988)
Peyton-Jones, S.L., Wadler, P.: Imperative Functional Programming. In: Twentieth ACM Symposium on Principles of Programming Languages (1993)
Reynolds, J.: The Essence of Algol. In: Algorithmic Languages, Proceedings of the International Symposium on Algorithmic Languages, pp. 345–372 (1981)
Reynolds, J.: Using Functor Categories to Generate Intermediate Code. In: Proceedings of the ACM Conference on the Principles of Programming Languages, pp. 25–36 (1995)
Stoy, J.E.: Denotational Semantics: the Scott-Strachey Approach to Programming Language Theory. MIT Press, Cambridge (1977)
Wadler, P.: The essence of functional programming. In: Proceedings of the ACM Conference on the Principles of Programming Languages, pp. 1–14 (1992)
Wand, M.: Deriving Target Code as a Representation of Continuation Semantics. ACM Transactions on Programming Languages and Systems 4(3), 496–517 (1982)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2000 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Harrison, W.L., Kamin, S.N. (2000). Metacomputation-Based Compiler Architecture. In: Backhouse, R., Oliveira, J.N. (eds) Mathematics of Program Construction. MPC 2000. Lecture Notes in Computer Science, vol 1837. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10722010_14
Download citation
DOI: https://doi.org/10.1007/10722010_14
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-67727-7
Online ISBN: 978-3-540-45025-2
eBook Packages: Springer Book Archive