skip to main content
research-article

Hybrid partial evaluation

Published:22 October 2011Publication History
Skip Abstract Section

Abstract

Hybrid partial evaluation (HPE) is a pragmatic approach to partial evaluation that borrows ideas from both online and offline partial evaluation. HPE performs offline-style specialization using an online approach without static binding time analysis. The goal of HPE is to provide a practical and predictable level of optimization for programmers, with an implementation strategy that fits well within existing compilers or interpreters. HPE requires the programmer to specify where partial evaluation should be applied. It provides no termination guarantee and reports errors in situations that violate simple binding time rules, or have incorrect use of side effects in compile-time code. We formalize HPE for a small imperative object-oriented language and describe Civet, a straightforward implementation of HPE as a relatively simple extension of a Java compiler. Code optimized by Civet performs as well as the output of a state-of-the-art offline partial evaluator.

References

  1. Andersen, L.: Program Analysis and Specialization for the C Programming Language. Ph.D. thesis, University of Copenhagen (1994), DIKU Research Report 94/19Google ScholarGoogle Scholar
  2. Braux, M., Noyé, J.: Towards partially evaluating reflection in Java. In: Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM). pp. 2--11. ACM, New York, NY, USA (1999) Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Brzozowski, J.A.: Derivatives of regular expressions. J. ACM 11, 481--494 (October 1964), http://doi.acm.org/10.1145/321239.321249 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Bulyonkov, M.: A theoretical approach to polyvariant mixed computation. Partial Evaluation and Mixed Computation (PEMC) pp. 51--64 (1988)Google ScholarGoogle Scholar
  5. Consel, C.: Polyvariant binding-time analysis for applicative languages. In: Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM). pp. 66--77 (1993) Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Consel, C., Hornof, L., Marlet, R., Muller, G., Thibault, S., Volanschi, E.N., Lawall, J., Noyé, J.: Tempo: specializing systems applications and beyond. ACM Comput. Surv. p. 19 (1998) Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Dean, J., Chambers, C., Grove, D.: Identifying profitable specialization in object-oriented languages. Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM) pp. 85--96 (1994)Google ScholarGoogle Scholar
  8. Dussart, D., Bevers, E., Vlaminck, K.D.: Polyvariant constructor specialisation. In: Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM). pp. 54--65 (1995) Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Ekman, T., Hedin, G.: The JastAdd system -- modular extensible compiler construction. Sci. Comput. Program. 69(1--3), 14--26 (2007) Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Ershov, A.P., Ostrovski, B.N.: Controlled mixed computation and its application to systematic development of language-oriented parsers. In: The IFIP TC2/WG 2.1 Working Conference on Program specification and transformation. pp. 31--48. North-Holland Publishing Co. (1987) Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Futamura, Y.: Partial evaluation of computation process - an approach to a compiler-compiler. Systems, Computers, Controls 2, 45--50 (1999)Google ScholarGoogle Scholar
  12. Hen-Tov, A., Lorenz, D.H., Pinhasi, A., Schachter, L.: Modeltalk: When everything is a domain-specific language. IEEE Softw. 26, 39--46 (July 2009) Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Jones, N.D., Gomard, C.K., Sestoft, P.: Partial evaluation and automatic program generation. Prentice-Hall, Inc., Upper Saddle River, NJ, USA (1993) Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Jones, S.P.: Haskell 98 Language and Libraries. Cambridge University Press (2003)Google ScholarGoogle Scholar
  15. Lawall, J.L., Danvy, O.: Continuation-based partial evaluation. SIGPLAN Lisp Pointers VII, 227--238 (July 1994) Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Le Meur, A.F., Lawall, J.L., Consel, C.: Specialization scenarios: A pragmatic approach to declaring program specialization. Higher Order Symbol. Comput. 17(1--2), 47--92 (2004) Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Lindholm, T., Yellin, F.: Java(TM) Virtual Machine Specification, The (2nd Edition). Prentice Hall PTR, 2 edn. (April 1999) Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Löh, A.: lhs2tex. http://people.cs.uu.nl/andres/lhs2tex/Google ScholarGoogle Scholar
  19. Marquard, M., Steensgaard, B.: Partial Evaluation of an Object-Oriented Imperative Language. Master's thesis, University of Copenhagen (DIKU) (April 1992)Google ScholarGoogle Scholar
  20. Meyer, U.: Correctness of on-line partial evaluation for a Pascal-like language. Sci. Comput. Program. 34(1), 55--73 (1999) Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Møller, A.: Finite-state automata and regular expressions for Java (2010), \texttthttp://www.brics.dk/automaton/Google ScholarGoogle Scholar
  22. Poole, J.D.: Model-driven architecture: Vision, standards and emerging technologies. In: ECOOP 2001, Workshop on Metamodeling and Adaptive Object Models (2001)Google ScholarGoogle Scholar
  23. Ruf, E., Weise, D.: Opportunities for online partial evaluation. Tech. Rep. CSL-TR-92--516, Computer Systems Laboratory, Stanford University, Stanford, CA (April 1992) Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Ruf, E.S.: Topics in online partial evaluation. Ph.D. thesis, Stanford University, Stanford, CA, USA (1993) Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Schultz, U.P., Lawall, J.L., Consel, C.: Automatic program specialization for Java. ACM Trans. Program. Lang. Syst. 25(4), 452--499 (2003) Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Schultz, U.P.: Partial evaluation for class-based object-oriented languages. In: PADO '01: Proceedings of the Second Symposium on Programs as Data Objects. pp. 173--197. Springer-Verlag, London, UK (2001) Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Thiemann, P., Dussart, D.: Partial evaluation for higher-order languages with state (1996), unpublished manuscriptGoogle ScholarGoogle Scholar
  28. Wadler, P.: Monads for functional programming. In: Advanced Functional Programming, First International Spring School on Advanced Functional Programming Techniques-Tutorial Text. pp. 24--52. Springer-Verlag, London, UK (1995) Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Hybrid partial evaluation

    Recommendations

    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 SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 46, Issue 10
      OOPSLA '11
      October 2011
      1063 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2076021
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA '11: Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications
        October 2011
        1104 pages
        ISBN:9781450309400
        DOI:10.1145/2048066

      Copyright © 2011 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 22 October 2011

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!