skip to main content
article
Open Access

The concept of a supercompiler

Published:01 June 1986Publication History
Skip Abstract Section

Abstract

A supercompiler is a program transformer of a certain type. It traces the possible generalized histories of computation by the original program, and compiles an equivalent program, reducing in the process the redundancy that could be present in the original program. The nature of the redundancy that can be eliminated by supercompilation may be various, e.g., some variables might have predefined values (as in partial evaluation), or the structure of control transfer could be made more efficient (as in lazy evaluation), or it could simply be the fact that the same variable is used more than once. The general principles of supercompilation are described and compared with the usual approach to program transformation as a stepwise application of a number of equivalence rules. It is argued that the language Refal serves the needs of supercompilation best. Refal is formally defined and compared with Prolog and other languages. Examples are given of the operation of a Refal supercompiler implemented at CCNY on an IBM/370.

References

  1. 1 BECKMAN, L., HARALDSON, A., OSKARSON, O., AND SANDEWALL, O. A partial evaluator and its use as a programming tool. Arti{. InteU. 7 (1974), 319-357.Google ScholarGoogle Scholar
  2. 2 BURSTALL, R. M., AND DARLINGTON, J. A transformation system for developing recursive programs. J. ACM 24 (1977), 44-67. Google ScholarGoogle Scholar
  3. 3 ERSHOV, A.P. On the essence of translation. In Formal Description of Programming Concepts, E. J. Neuhold, Ed., North-Holland, Amsterdam, 1977, 391-418.Google ScholarGoogle Scholar
  4. 4 ERSHOV, A. P. Mixed computation: Potential applications and problems for future studies. Theor. Comput. Sci. 18 (1982), 41-67.Google ScholarGoogle Scholar
  5. 5 FRIEDMAN, D. P., AND WISE, D.S. CONS should not evaluate its arguments. In Automata, Languages and Programming, Michaelson and Millner, Eds, Edinburgh University Press, 1967, 257-284.Google ScholarGoogle Scholar
  6. 6 FUTAMURA, Y. Partial evaluation of computation process--an approach to a compiler-compiler. Syst. Comput. Control 2, 5 (1971), 45-50.Google ScholarGoogle Scholar
  7. 7 FUTAMURA, Y. Partial computation of programs. In Proceedings RIMS Symposium on Software Science and Engineering, LNCS 147, Springer-Verlag, New York, 1983, 1-35. Google ScholarGoogle Scholar
  8. 8 HENDERSON, P., AND MORRIS, J. H., JR. A lazy evaluator. In Proceedings 3rd Symposium on POPL (1976), 95-103. Google ScholarGoogle Scholar
  9. 9 JONES, N., AND SCHMIDT, D. Compiler generation from denotational semantics. In Semantics- Driven Compiler Generation, LNCS 94, Springer-Verlag, New York, 1980, 70-93. Google ScholarGoogle Scholar
  10. 10 JONES, N. D., SESTOFT, P., AND S~NDERGAARD, H. An experiment in partial evaluation: The generation of a compiler generator. In International Conference on Rewriting Techniques and Applications (1985), Springer-Verlag, New York, (forthcoming). Google ScholarGoogle Scholar
  11. 11 JONES, N., AND TOFTE, M. Some principles and notation for the construction of compiler generators. DIKU, Internal Rep., Univ. of Copenhagen, 1983.Google ScholarGoogle Scholar
  12. 12 LOMBARDI, L.A. Incremental computation. In Advances in Computers, 8, Academic Press, New York, 1967.Google ScholarGoogle Scholar
  13. 13 NILLSON, N.J. Artificial intelligence prepares for 2001. AI Mag. 4 (1983), 7-14.Google ScholarGoogle Scholar
  14. 14 O'SHEA, T., AND EISENSTADT, M. Artificial Intelligence. Harper and Row, New York, 1984.Google ScholarGoogle Scholar
  15. 15 PARTSCH, H., AND STEINBRUEGGEN, R. Program transformation systems. ACM Comput. Surv. 15 (1983), 199-236. Google ScholarGoogle Scholar
  16. 16 REDDY, U. Narrowing as the operational semantics of functional languages. Submitted to the Symposium on Logic Programming (Boston, 1985).Google ScholarGoogle Scholar
  17. 17 Basic Refal and its Implementation on Computers. GOSSTROI SSSR, TsNIPIASS, Moscow, 1977. The authors are not indicated in the book. They are: V. F. Khoroshevski, And. V. Klimov, Ark. V. Klimov, A. G. Krasovski, S. A. Romanenko, I. B. Shchenkov, and V. F. Turchin. (In Russian)Google ScholarGoogle Scholar
  18. 18 SOWA, J.F. A prologue to Prolog. Draft, distributed with permission of the author, 1984.Google ScholarGoogle Scholar
  19. 19 TURCmN, V.F. Equivalent transformation of recursive functions defined in Refal. In Trudy Vsesoyuzn. Simpos. "Teoria Yazykov i metody progr," Alushta-Kiev, 1972, 31-42. (In Russian)Google ScholarGoogle Scholar
  20. 20 TURCHIN, V.F. A supercompiler system based on the language Refal. SIGPLANNot. 14 (1979), 46-54. Google ScholarGoogle Scholar
  21. 21 TURCHIN, V. F. The language Refal, the theory of compilation, and metasystem analysis. Courant Institute Rep. 20, 1980.Google ScholarGoogle Scholar
  22. 22 TURCH1N, V. F. Semantics definitions in Refal and automatic production of compilers. In Semantics-Driven Compiler Generation, LNCS 94, N. Jones, Ed., Springer-Verlag, New York, 1980, 443-474. Google ScholarGoogle Scholar
  23. 23 TURCHIN, V. F., NIRENBERG, R. N., AND TURCHIN, D.V. Experiments with a supercompiler. In ACM Symposium on LISP and Functional Programming (1982), ACM, New York, 47-55. Google ScholarGoogle Scholar
  24. 24 VUILLEMIN, J. Correct and optimal implementation of recursion in a simple programming language. J. Comput. Syst. Stud. 9, 3 (Dec. 1974).Google ScholarGoogle Scholar

Index Terms

  1. The concept of a supercompiler

            Recommendations

            Reviews

            Jacek Gibert

            The concept of a supercompiler provides a declarative way of viewing programming and compilation. This contrasts with the common perception of practical programming as “wizardry” that requires an intimate knowledge of a complex compiler and a messy reference manual. Supercompilation allows a programmer to deal only with the mathematical model of a programming problem without concern about efficiency. The generation of an efficient algorithm is then taken care of by the supercompiler. Supercompilation is similar to existing optimizing compilers in that the supercompiler aims to generate optimal target code; but, more important, it also SUPERvises the efficient execution of the code. The author argues this point through a series of rather lengthy paragraphs in the first few sections and promises to illustrate supercompilation on some examples in the final sections. But first, he defines an applicative language Refal in which the examples will be formulated. Refal was the main subject of a number of previous papers by the same author and one wonders whether it is really necessary to go through two lengthy sections to understand coming examples. Unfortunately, the author does not go into details of strategies of supercompilation, but rather concentrates on Refal and discusses two simple examples of supercompilation performed by the CCNY supercompiler. The first example deals with “driving,” or partial evaluation of function uninstantiated parameters, and the other one demonstrates removing redundancy caused by repeated variable names. Finally, an application of the supercompiler as a compiler for a simple FORTRAN-like language is discussed, and some performance statistics are quoted. In summary, the concept of supercompilation presented in this paper will appeal mostly to those involved in the methodology and design of “new generation” compilers, especially for applicative languages. Unfortunately, readers working actively in functional programming will most likely find the author discussing matters already covered more deeply elsewhere.

            Access critical reviews of Computing literature here

            Become a reviewer for Computing Reviews.

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in

            Full Access

            • Published in

              cover image ACM Transactions on Programming Languages and Systems
              ACM Transactions on Programming Languages and Systems  Volume 8, Issue 3
              The MIT Press scientific computation series
              July 1986
              135 pages
              ISSN:0164-0925
              EISSN:1558-4593
              DOI:10.1145/5956
              Issue’s Table of Contents

              Copyright © 1986 ACM

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 1 June 1986
              Published in toplas Volume 8, Issue 3

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • article

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader