Abstract
We have experimentally validated the theoretical insight, that a compiler generator is an Ershov generating extension of a program specializer, by showing that an existing offline partial evaluator can perform the fourth Futamura projection. Specifically, an online and an offline partial evaluator for an imperative flowchart language were transformed into two new compiler generators by Romanenko’s classical partial evaluator Unmix. The two partial evaluators are described, as is a novel recursive method for polyvariant specialization. The new compiler generators are demonstrated by converting a universal parser into a parser generator. These results strongly indicate that existing partial evaluation techniques can be put to work on several new applications. To date, all previous compiler generators based on partial evaluation were either generated by self-application or handwritten. None of these works considered the generation of one compiler generator by another.
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
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)
Debois, S.: Imperative-program transformation by instrumented-interpreter specialization. Higher-Order and Symbolic Computation 21(1-2), 37–58 (2008)
Ershov, A.P.: On the partial computation principle. Information Processing Letters 6(2), 38–41 (1977)
Futamura, Y.: Partial computation of programs. In: Goto, E., Nakajima, R., Yonezawa, A., Nakata, I., Furukawa, K. (eds.) RIMS 1982. LNCS, vol. 147, pp. 1–35. Springer, Heidelberg (1983)
Futamura, Y.: Partial evaluation of computation process, revisited. Higher-Order and Symbolic Computation 12(4), 377–380 (1999)
Futamura, Y., Konishi, Z., Glück, R.: WSDFU: Program transformation system based on generalized partial computation. In: Mogensen, T.Æ., Schmidt, D.A., Sudborough, I.H. (eds.) The Essence of Computation. LNCS, vol. 2566, pp. 358–378. Springer, Heidelberg (2002)
Gade, J., Glück, R.: On Jones-optimal specializers: a case study using Unmix. In: Kobayashi, N. (ed.) APLAS 2006. LNCS, vol. 4279, pp. 406–422. Springer, Heidelberg (2006)
Glück, R.: An investigation of Jones optimality and BTI-universal specializers. Higher-Order and Symbolic Computation 21(3), 283–309 (2008)
Glück, R.: Is there a fourth Futamura projection? Partial Evaluation and Program Manipulation. Proceedings, pp. 51–60. ACM Press, New York (2009)
Glück, R., Jørgensen, J.: Efficient multi-level generating extensions for program specialization. In: Hermenegildo, M., Swierstra, S.D. (eds.) PLILP 1995. LNCS, vol. 982, pp. 259–278. Springer, Heidelberg (1995)
Glück, R., Kawada, Y., Hashimoto, T.: Transforming interpreters into inverse interpreters by partial evaluation. In: Proceedings of Partial Evaluation and Semantics-Based Program Manipulation, pp. 10–19. ACM Press, New York (2003)
Glück, R., Klimov, A.V.: Occam’s razor in metacomputation: the notion of a perfect process tree. In: Cousot, P., Falaschi, M., Filé, G., Rauzy, A. (eds.) WSA 1993. LNCS, vol. 724, pp. 112–123. Springer, Heidelberg (1993)
Gomard, C.K., Jones, N.D.: Compiler generation by partial evaluation: a case study. Structured Programming 12, 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)
Holst, C.K.: Language triplets: the Amix approach. In: Bjørner, D., et al. (eds.) Partial Evaluation and Mixed Computation, pp. 167–185. North-Holland, Amsterdam (1988)
Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs (1993)
Jones, N.D., Sestoft, P., Søndergaard, H.: Mix: a self-applicable partial evaluator for experiments in compiler generation. Lisp and Symbolic Computation 2(1), 9–50 (1989)
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)
Romanenko, S.A.: Arity raiser and its use in program specialization. In: Jones, N.D. (ed.) ESOP 1990. LNCS, vol. 432, pp. 341–360. Springer, Heidelberg (1990)
Romanenko, S.A.: The specializer Unmix (1990), Program and documentation, ftp://ftp.diku.dk/pub/diku/dists/jones-book/Romanenko/
Ruf, E., Weise, D.: On the specialization of online program specializers. Journal of Functional Programming 3(3), 251–281 (1993)
Sumii, E., Kobayashi, N.: Online-and-offline partial evaluation: a mixed approach. In: Proceedings of Partial Evaluation and Semantics-Based Program Manipulation, pp. 12–21. ACM Press, New York (2000)
Turchin, V.F.: The concept of a supercompiler. ACM TOPLAS 8(3), 292–325 (1986)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Glück, R. (2010). An Experiment with the Fourth Futamura Projection. In: Pnueli, A., Virbitskaite, I., Voronkov, A. (eds) Perspectives of Systems Informatics. PSI 2009. Lecture Notes in Computer Science, vol 5947. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-11486-1_12
Download citation
DOI: https://doi.org/10.1007/978-3-642-11486-1_12
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-11485-4
Online ISBN: 978-3-642-11486-1
eBook Packages: Computer ScienceComputer Science (R0)