Removing value encoding using alternative values in partial evaluation of strongly-typed languages

  • Denis Bechet
Contributed Papers
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1058)


There is a main difference between a program which is interpreted by an interpreter written in a strongly-typed language and a compiled version. Such an interpreter usually uses a universal domain for the values it manipulates. A value encoding is necessary. A compiled program works directly on values. A layer of interpretation for value representation is inserted. On the other hand, a way to derive automatically a compiler from an interpreter is to use a partial evaluator applied to the interpreter and the interpreted program. This leads to a problem when we want that this technique removes all the layer of interpretation because value encoding must disappear. It is not the case for conventional partial evaluator. This paper proposes to introduce a new domain for partial evaluators called alternative values and a new algorithm of specialization (based on events) which can solve this problem of removing value encoding. We conclude by reporting a successful specialization of an interpreter written in a strongly-typed language by the partial evaluator LaMix which is based on those ideas.


partial evaluation alternative values type specialization interpreters strongly-typed language 


  1. 1.
    D. Bechet. Les valeurs alternatives et la notion d'événement dans l'évaluation partielle. PhD thesis, Université de Paris VII, Paris, France, October 1995.Google Scholar
  2. 2.
    C. Consel and O. Danvy. Tutorial notes on partial evaluation. In Twentieth ACM Symposium on Principles of Programming Languages, Charleston, South Carolina, January 1993, pages 493–501. ACM, New York: ACM, 1993.Google Scholar
  3. 3.
    D. Dussart, E. Bevers, and K. de Vlaminck. Polyvariant constructor specialisation. In Partial Evaluation and Semantics-Based Program Manipulation, La Jolla, California, June 1995, pages 54–65. ACM SIGPLAN, 1995.Google Scholar
  4. 4.
    Y. Futamura. Partial evaluation of computation process — an approach to a compiler-compiler. Systems, Computers, Controls, 2(5):45–50, 1971.Google Scholar
  5. 5.
    A. Haraldsson. A Program Manipulation System Based on Partial Evaluation. PhD thesis, Linköping University, Sweden, 1977. Linköping Studies in Science and Technology Dissertations 14.Google Scholar
  6. 6.
    N.D. Jones, C.K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Englewood Cliffs, NJ: Prentice Hall, 1993.Google Scholar
  7. 7.
    J. Launchbury. Projection Factorisations in Partial Evaluation. Cambridge: Cambridge University Press, 1991.Google Scholar
  8. 8.
    J. Launchbury. A strongly-typed self-applicable partial evaluator. In J. Hughes, editor, Functional Programming Languages and Computer Architecture, Cambridge, Massachusetts, August 1991 (Lecture Notes in Computer Science, vol. 523), pages 145–164. ACM, Berlin: Springer-Verlag, 1991.Google Scholar
  9. 9.
    T. Mogensen. Partially static structures in a self-applicable partial evaluator. In D. Bjørner, A.P. Ershov, and N.D. Jones, editors, Partial Evaluation and Mixed Computation, pages 325–347. Amsterdam: North-Holland, 1988.Google Scholar
  10. 10.
    T. Mogensen. Constructor specialization. In Partial Evaluation and Semantics-Based Program Manipulation, Copenhagen, Denmark, June 1993, pages 22–32. New York: ACM, 1993.Google Scholar
  11. 11.
    A. Salomaa. Formal languages. Computer Science Classics. Academic Press, Inc., 1987.Google Scholar
  12. 12.
    V.F. Turchin. A supercompiler system based on the language Refal. SIGPLAN Notices, 14(2):46–54, February 1979.Google Scholar
  13. 13.
    Pierre Weis and Xavier Leroy. Le Langage CAML. InterEditions, 1993.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Denis Bechet
    • 1
  1. 1.CRIN-CNRS & INRIA-LorraineVandœuvre-les-NancyFrance

Personalised recommendations