Skip to main content

Metacomputation-Based Compiler Architecture

  • Conference paper
Mathematics of Program Construction (MPC 2000)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1837))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading (1986)

    Google Scholar 

  2. Appel, A.: Modern Compiler Implementation in ML. Cambridge University Press, New York (1998)

    Google Scholar 

  3. Appel, A.: Compiling with Continuations. Cambridge University Press, New York (1992)

    Google Scholar 

  4. Danvy, O.: Type-Directed Partial Evaluation. In: Proceedings of the ACM Conference on the Principles of Programming Languages (1996)

    Google Scholar 

  5. 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)

    Google Scholar 

  6. Davies, R., Pfenning, F.: A Modal Analysis of Staged Computation. In: Proceedings of the ACM Conference on the Principles of Programming Languages (1996)

    Google Scholar 

  7. Espinosa, D.: ”Semantic Lego”, Doctoral Dissertation, Columbia University (1995)

    Google Scholar 

  8. Harrison, W., Kamin, S.: Modular Compilers Based on Monad Transformers. In: Proceedings of the IEEE International Conference on Programming Languages, pp. 122–131 (1998)

    Google Scholar 

  9. Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs (1993)

    MATH  Google Scholar 

  10. Jorring, U., Scherlis, W.: Compilers and Staging Transformations. In: Proceedings of the ACM Conference on the Principles of Programming Languages (1986)

    Google Scholar 

  11. Lee, P.: Realistic Compiler Generation. MIT Press, Cambridge (1989)

    Google Scholar 

  12. Liang, S.: A Modular Semantics for Compiler Generation, Yale University Department of Computer Science Technical Report TR-1067 (February 1995)

    Google Scholar 

  13. Liang, S., Hudak, P., Jones, M.: Monad Transformers and Modular Interpreters. In: Proceedings of the ACM Conference on the Principles of Programming Languages (1995)

    Google Scholar 

  14. Liang, S.: Modular Monadic Semantics and Compilation, Doctoral Thesis, Yale University (1997)

    Google Scholar 

  15. Mogensen, T.: Separating Binding Times in Language Specifications. In: Proceedings of the ACM Conference on Functional Programming and Computer Architecture, pp. 12–25 (1989)

    Google Scholar 

  16. Moggi, E.: Notions of Computation and Monads. Information and Computation 93(1), 55–92 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  17. Mosses, P.: Action Semantics. Cambridge University Press, Cambridge (1992)

    Book  MATH  Google Scholar 

  18. 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)

    Google Scholar 

  19. Nielson, H., Nielson, F.: Automatic Binding Time Analysis for a Typed λ- calculus. Science of Computer Programming 10(2), 139–176 (1988)

    Article  MATH  MathSciNet  Google Scholar 

  20. Peyton-Jones, S.L., Wadler, P.: Imperative Functional Programming. In: Twentieth ACM Symposium on Principles of Programming Languages (1993)

    Google Scholar 

  21. Reynolds, J.: The Essence of Algol. In: Algorithmic Languages, Proceedings of the International Symposium on Algorithmic Languages, pp. 345–372 (1981)

    Google Scholar 

  22. 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)

    Google Scholar 

  23. Stoy, J.E.: Denotational Semantics: the Scott-Strachey Approach to Programming Language Theory. MIT Press, Cambridge (1977)

    Google Scholar 

  24. Wadler, P.: The essence of functional programming. In: Proceedings of the ACM Conference on the Principles of Programming Languages, pp. 1–14 (1992)

    Google Scholar 

  25. Wand, M.: Deriving Target Code as a Representation of Continuation Semantics. ACM Transactions on Programming Languages and Systems 4(3), 496–517 (1982)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics