Abstract
In this paper we present a method for generating very efficient code from continuation-style denotational semantics. We claim that this form arises naturally in the definition of procedural languages, such as C. Once the language semantics has been simplified using a compile-time versus run-time distinction, we recognize two important properties of the resulting form, single-threading and label-freeness of closures. The first allows a conventional call-by-value execution with a single store. The second property is central to our work, as it allows bindings and closure creation to be replaced by assignments to uniquely named variables, i.e. quadruples. These quadruples are then passed on to a conventional code optimizer and generator. As far as we know, this is the first time a quality code compiler has been generated which does not rely on either β-reductions or an abstract stack machine.
This work was supported by the Swedish Board for Technical Development (STU).
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
9. References
Appel, Andrew W. Compile-time Evaluation and Code Generation for Semantics-directed Compilers (Ph.D. thesis, Carnegie-Mellon Univ., 1985)
Aho, A. V., Sethi, R. and Ullman J. D. Compilers Principles, Techniques and Tools (Addison-Wesley, 1986).
Barendregt, H.P. The Lambda Calculus, Its Syntax and Semantics (Revised Edition, North-Holland, 1984)
Paulson, L. A Semantics-Directed Compiler Generator (Proceedings 9th ACM Conference on Principles of Programming Languages, p. 224–233)
Pettersson, M. Generating Interpreters from Denotational Definitions using C++ as a Meta-language (Report LiTH-IDA-R-89-52, Linköping Univ, 1989)
Raskovsky, Martin R. Denotational Semantics as a Specification of Code Generators (Proceedings ACM SIGPLAN 82 Conference on Compiler Construction, p. 230–244)
Schmidt, David A. An implementation from a direct semantics definition, in: N.D. Jones, Ed., Proc. Workshop on Programs as Data Objects (LNCS 217, Springer, Berlin, 1985).
Sethi, Ravi. Control flow aspects of semantics directed compiling (CSTR-98, Bell Labs, 1981)
Stallman, Richard M. Using and Porting GNU CC (Free Software Foundation, 1989)
Stoy, Joseph E. Denotational Semantics (MIT Press, Cambridge, MA, 1977)
Wall, David A. and Powell, Michael L. The Mahler Experience: Using an Intermediate Language as the Machine Description (DECWRL Technical Report 87/1, 1987)
Wand, Mitchell. Semantics-Directed Machine Architecture (Proceedings 1982 ACM Conference on Lisp and Functional Programming)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Pettersson, M. (1991). Generating efficient code from continuation semantics. In: Hammer, D. (eds) Compiler Compilers. CC 1990. Lecture Notes in Computer Science, vol 477. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-53669-8_81
Download citation
DOI: https://doi.org/10.1007/3-540-53669-8_81
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-53669-7
Online ISBN: 978-3-540-46953-7
eBook Packages: Springer Book Archive