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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
Beckman, L., Haraldson, A., Oskarsson, Ö., Sandewall, E.: A partial evaluator and its use as a programming tool. Artificial Intelligence 7, 319–357 (1976)
Bulyonkov, M.A.: Polyvariant mixed computation for analyzer programs. Acta Informatica 21(5), 473–484 (1984)
Christensen, N.H., Glück, R.: Offline partial evaluation can be as accurate as online partial evaluation. ACM TOPLAS 26(1), 191–220 (2004)
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)
Ershov, A.P.: On the partial computation principle. Information Processing Letters 6(2), 38–41 (1977)
Ershov, A.P.: Mixed computation in the class of recursive program schemata. Acta Cybernetica 4(1), 19–23 (1978)
Futamura, Y.: Partial evaluation of computing process – an approach to a compiler-compiler. Systems, Computers, Controls 2(5), 45–50 (1971)
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)
Futamura, Y., Konishi, Z., Glück, R.: Program transformation system based on generalized partial computation. New Generation Computing 20(1), 75–99 (2001)
Glück, R.: Is there a fourth Futamura projection? In: Partial Evaluation and Program Manipulation. Proceedings, pp. 51–60. ACM Press (2009)
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)
Glück, R.: Self-generating program specializers. Information Processing Letters 110(17), 787–793 (2010)
Glück, R.: A self-applicable online partial evaluator for recursive flowchart languages. Software – Practice and Experience (to appear, 2012)
Glück, R., Jørgensen, J.: An automatic program generator for multi-level specialization. Lisp and Symbolic Computation 10(2), 113–158 (1997)
Gomard, C.K., Jones, N.D.: Compiler generation by partial evaluation: a case study. Structured Programming 12(3), 123–144 (1991)
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)
Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall (1993)
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)
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)
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)
Masterson Jr., K.S.: Compilation for two computers with NELIAC. Communications of the ACM 3(11), 607–611 (1960)
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)
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)
Sumii, E., Kobayashi, N.: A hybrid approach to online and offline partial evaluation. Higher-Order and Symbolic Computation 14(2-3), 101–142 (2001)
Thiemann, P.: Cogen in six lines. In: ACM International Conference on Functional Programming, pp. 180–189. ACM Press (1996)
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)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)