Skip to main content

Bootstrapping Compiler Generators from Partial Evaluators

  • Conference paper
Perspectives of Systems Informatics (PSI 2011)

Part of the book series: Lecture Notes in Computer Science ((LNISA,volume 7162))

Abstract

This paper shows that bootstrapping of compiler generators from program specializers is a viable alternative to the third Futamura projection. To practically validate the technique, a novel partial evaluation-based compiler generator was designed and implemented for a recursive flowchart language. Three-step bootstrapping was found to be faster and to produce the same compiler generator that Gomard and Jones produced two decades ago by double self-application. Compiler-generator bootstrapping has distinct properties that are not present in the classic three Futamura projections, such as the ability to turn a specializer into a compiler generator in one step without self-application. Up to now, the approach of hand-writing compiler generators has only been used to avoid difficulties when specializing strongly-typed languages, not as a first step towards compiler-generator bootstrapping.

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. Abramov, S.M., Glück, R.: Principles of inverse computation and the universal resolving algorithm. In: Mogensen, T.Æ., Schmidt, D.A., Sudborough, I.H. (eds.) The Essence of Computation. LNCS, vol. 2566, pp. 269–295. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  2. Beckman, L., Haraldson, A., Oskarsson, Ö., Sandewall, E.: A partial evaluator and its use as a programming tool. Artificial Intelligence 7, 319–357 (1976)

    Article  MATH  Google Scholar 

  3. Bulyonkov, M.A.: Polyvariant mixed computation for analyzer programs. Acta Informatica 21(5), 473–484 (1984)

    Article  MathSciNet  MATH  Google Scholar 

  4. Christensen, N.H., Glück, R.: Offline partial evaluation can be as accurate as online partial evaluation. ACM TOPLAS 26(1), 191–220 (2004)

    Article  Google Scholar 

  5. Consel, C., Lawall, J.L., Le Meur, A.F.: A tour of Tempo: a program specializer for the C language. Science of Computer Programming 52(1-3), 341–370 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  6. Ershov, A.P.: On the partial computation principle. Information Processing Letters 6(2), 38–41 (1977)

    Article  MATH  Google Scholar 

  7. Ershov, A.P.: Mixed computation in the class of recursive program schemata. Acta Cybernetica 4(1), 19–23 (1978)

    MathSciNet  MATH  Google Scholar 

  8. Futamura, Y.: Partial evaluation of computing process – an approach to a compiler-compiler. Systems, Computers, Controls 2(5), 45–50 (1971)

    Google Scholar 

  9. Futamura, Y.: Partial computation of programs. In: Goto, E., Furukawa, K., Nakajima, R., Nakata, I., Yonezawa, A. (eds.) RIMS Symposia on Software Science and Engineering. Proceedings. LNCS, vol. 147, pp. 1–35. Springer, Heidelberg (1983)

    Google Scholar 

  10. Futamura, Y., Konishi, Z., Glück, R.: Program transformation system based on generalized partial computation. New Generation Computing 20(1), 75–99 (2001)

    Article  Google Scholar 

  11. Glück, R.: Is there a fourth Futamura projection? In: Partial Evaluation and Program Manipulation. Proceedings, pp. 51–60. ACM Press (2009)

    Google Scholar 

  12. Glück, R.: An experiment with the fourth Futamura projection. In: Pnueli, A., Virbitskaite, I., Voronkov, A. (eds.) PSI 2009. LNCS, vol. 5947, pp. 135–150. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  13. Glück, R.: Self-generating program specializers. Information Processing Letters 110(17), 787–793 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  14. Glück, R.: A self-applicable online partial evaluator for recursive flowchart languages. Software – Practice and Experience (to appear, 2012)

    Google Scholar 

  15. Glück, R., Jørgensen, J.: An automatic program generator for multi-level specialization. Lisp and Symbolic Computation 10(2), 113–158 (1997)

    Article  Google Scholar 

  16. Gomard, C.K., Jones, N.D.: Compiler generation by partial evaluation: a case study. Structured Programming 12(3), 123–144 (1991)

    MathSciNet  Google Scholar 

  17. Hatcliff, J.: An Introduction to Online and Offline Partial Evaluation Using a Simple Flowchart Language. In: Hatcliff, J., Mogensen, T.Æ., Thiemann, P. (eds.) DIKU 1998. LNCS, vol. 1706, pp. 20–82. Springer, Heidelberg (1999)

    Google Scholar 

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

    Google Scholar 

  19. Jones, N.D., Sestoft, P., Søndergaard, H.: An experiment in partial evaluation: the generation of a compiler generator. In: Jouannaud, J.-P. (ed.) RTA 1985. LNCS, vol. 202, pp. 124–140. Springer, Heidelberg (1985)

    Chapter  Google Scholar 

  20. Klimov, A.V., Romanenko, S.A.: Metavychislitel’ dlja jazyka Refal. Osnovnye ponjatija i primery. (A metaevaluator for the language Refal. Basic concepts and examples). Preprint 71, Keldysh Institute of Applied Mathematics, Academy of Sciences of the USSR, Moscow (1987) (in Russian)

    Google Scholar 

  21. Leuschel, M., Jørgensen, J.: Efficient specialisation in Prolog using the hand-written compiler generator LOGEN. Electronic Notes in Theoretical Computer Science 30(2), 157–162 (2000)

    Article  Google Scholar 

  22. Masterson Jr., K.S.: Compilation for two computers with NELIAC. Communications of the ACM 3(11), 607–611 (1960)

    Article  MATH  Google Scholar 

  23. Romanenko, S.A.: A compiler generator produced by a self-applicable specializer can have a surprisingly natural and understandable structure. In: Bjørner, D., Ershov, A.P., Jones, N.D. (eds.) Partial Evaluation and Mixed Computation, pp. 445–463. North-Holland (1988)

    Google Scholar 

  24. Sestoft, P.: The structure of a self-applicable partial evaluator. Tech. Rep. 85/11, DIKU, University of Copenhagen, Denmark (1985), extended version of a paper with the same title in LNCS, vol. 217, pp. 236–256 (1986)

    Google Scholar 

  25. Sumii, E., Kobayashi, N.: A hybrid approach to online and offline partial evaluation. Higher-Order and Symbolic Computation 14(2-3), 101–142 (2001)

    Article  MATH  Google Scholar 

  26. Thiemann, P.: Cogen in six lines. In: ACM International Conference on Functional Programming, pp. 180–189. ACM Press (1996)

    Google Scholar 

  27. Turchin, V.F.: Metacomputation: metasystem transitions plus supercompilation. In: Danvy, O., Thiemann, P., Glück, R. (eds.) Partial Evaluation 1996. LNCS, vol. 1110, pp. 481–509. Springer, Heidelberg (1996)

    Chapter  Google Scholar 

  28. Wilkes, M.V.: An experiment with a self-compiling compiler for a simple list-processing language. Annual Review in Automatic Programming 4, 1–48 (1964)

    Article  Google Scholar 

  29. Yokoyama, T., Glück, R.: A reversible programming language and its invertible self-interpreter. In: Partial Evaluation and Program Manipulation. Proceedings, pp. 144–153. ACM Press (2007)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Glück, R. (2012). Bootstrapping Compiler Generators from Partial Evaluators. In: Clarke, E., Virbitskaite, I., Voronkov, A. (eds) Perspectives of Systems Informatics. PSI 2011. Lecture Notes in Computer Science, vol 7162. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-29709-0_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-29709-0_13

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-29708-3

  • Online ISBN: 978-3-642-29709-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics