Skip to main content
Log in

Specialization Scenarios: A Pragmatic Approach to Declaring Program Specialization

  • Published:
Higher-Order and Symbolic Computation

Abstract

Partial evaluation is a program transformation that automatically specializes a program with respect to invariants. Despite successful application in areas such as graphics, operating systems, and software engineering, partial evaluators have yet to achieve widespread use. One reason is the difficulty of adequately describing specialization opportunities. Indeed, underspecialization or overspecialization often occurs, without any feedback as to the source of the problem.

We have developed a high-level, module-based language allowing the program developer to guide the choice of both the code to specialize and the invariants to exploit during the specialization process. To ease the use of partial evaluation, the syntax of this language is similar to the declaration syntax of the target language of the partial evaluator. To provide feedback, declarations are checked during the analyses performed by partial evaluation. The language has been successfully used by a variety of users, including students having no previous experience with partial evaluation.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Andersen, L. Program analysis and specialization for the C programming language. Ph.D. thesis, Computer Science Department, University of Copenhagen. DIKU Technical Report 94/19, 1994.

  2. Ashley, J.M. and Consel, C. Fixpoint computation for polyvariant static analyses of higher-order applicative programs. ACM Transactions on Programming Languages and Systems, 16(5) (1994) 1431-1448.

    Google Scholar 

  3. Berlin, A. and Surati, R. Partial evaluation for scientific computing: The supercomputer toolkit experience. In ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation. Orlando, FL, USA, 1994, pp. 133-141, Technical Report 94/9, University of Melbourne, Australia.

    Google Scholar 

  4. Blazy, S. Specifying and automatically generating a specialization tool for Fortran 90. Journal on Automated Software Engineering, 7(4) (2000) 345-376.

    Google Scholar 

  5. Bondorf, A. Improving binding times without explicit CPS-conversion. In ACM Conference on Lisp and Functional Programming. ACM Press, San Francisco, CA, USA, 1992, pp. 1-10.

    Google Scholar 

  6. C-Mix. C-MixII user and reference manual, 2000. Available at: http://www.diku.dk/research-groups/topps/activities/cmix/download/.

  7. Christensen, N.H., Glück, R., and Laursen, S. Binding-time analysis in partial evaluation: One size does not fit all. In Perspectives of System Informatics, Third International Andrei Ershov Memorial Conference, PSI'99, D. Bjørner, M. Broy, and A.V. Zamulin (Eds.), vol. 1755 of Lecture Notes in Computer Science. Akademgorodok, Novosibirsk, Russia, 1999, pp. 80-92.

    Google Scholar 

  8. Consel, C. A tour of Schism: A partial evaluation system for higher-order applicative languages. In Partial Evaluation and Semantics-Based Program Manipulation. ACM Press, Copenhagen, Denmark, 1993, pp. 66-77.

    Google Scholar 

  9. Consel, C. and Danvy, O. Partial evaluation of pattern matching in strings. Information Processing Letters, 30(2) (1989) 79-86.

    Google Scholar 

  10. Consel, C. and Danvy, O. For a better support of static data flow. In Functional Programming Languages and Computer Architecture, J. Hughes (Ed.), vol. 523 of Lecture Notes in Computer Science, Springer-Verlag, Cambridge, MA, USA, 1991, pp. 496-519.

    Google Scholar 

  11. Consel, C., Hornof, L., Noël, F., Noyé, J., and Volanschi, E. A uniform approach for compile-time and run-time specialization. In Partial Evaluation, International Seminar, Dagstuhl Castle, O. Danvy, R. Glück, and P. Thiemann (Eds.), 1996, pp. 54-72.

  12. Consel, C. and Khoo, S. Parameterized partial evaluation. ACM Transactions on Programming Languages and Systems, 15(3) (1993) 463-493.

    Google Scholar 

  13. Constable, R., Allen, S., Bromley, H., Cleaveland, W., Cremer, J., Harper, R., Howe, D., Knoblock, T., Mendler, N., Panangaden, P., Sasaki, J., and Smith, S. Implementing Mathematics with the Nuprl Development System. Prentice-Hall, 1986.

  14. Danvy, O. Type-directed partial evaluation. In Hatcliff et al. [19], Springer-Verlag, 1998, pp. 367-411.

  15. Engler, D., Hsieh, W., and Kaashoek, M. 'C: A language for high-level, efficient, and machine-independent dynamic code generation. In Conference Record of the 23rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM Press, St. Petersburg Beach, FL, USA, 1996, pp. 131-144.

    Google Scholar 

  16. Grant, B., Mock, M., Philipose, M., Chambers, C., and Eggers, S. The benefits and costs of DyC's run-time optimizations. ACM Transactions on Programming Languages and Systems, 22(5) (2000a) 932-972.

    Google Scholar 

  17. Grant, B., Mock, M., Philipose, M., Chambers, C., and Eggers, S. DyC: An expressive annotation-directed dynamic compiler for C. Theoretical Computer Science, 248(1/2) (2000b) 147-199.

    Google Scholar 

  18. Grobauer, B. Cost recurrences for DML programs. In ICFP 2001: International Conference on Functional Programming. ACM Press, Florence, Italy, 2001, pp. 253-264.

    Google Scholar 

  19. Hatcliff, J., Mogensen, T.Æ., and Thiemann, P. (Eds.). Partial evaluation—Practice and theory. In Proceedings of the 1998 DIKU Summer School, vol. 1706 of Lecture Notes in Computer Science. Springer-Verlag, Copenhagen, Denmark, 1998.

  20. Hornof, L. and Noyé, J. Accurate binding-time analysis for imperative languages: Flow, context, and return sensitivity. Theoretical Computer Science, 248(1/2) (2000) 3-27.

    Google Scholar 

  21. Hughes, J. A type specialisation tutorial. In Hatcliff et al. [19], Springer-Verlag, 1998, pp. 293-325.

  22. Jones, N. What not to do when writing an interpreter for specialisation. In Partial Evaluation, International Seminar, Dagstuhl Castle, O. Danvy, R. Glück, and P. Thiemann (Eds.), 1996, pp. 216-237.

  23. Jones, N., Gomard, C., and Sestoft, P. Partial Evaluation and Automatic Program Generation. International Series in Computer Science, Prentice-Hall, 1993.

  24. Jørgensen, J. Generating a compiler for a lazy language by partial evaluation. In Conference Record of the Nineteenth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM Press, Albuquerque, NM, USA, 1992, pp. 258-268.

    Google Scholar 

  25. Knoblock, T. and Ruf, E. Data specialization. In PLDI'96 [36], 1996, pp. 215-225, ACM SIGPLAN Notices, vol. 31,no. 5. Also TR MSR-TR-96-04, Microsoft Research, February 1996.

    Google Scholar 

  26. Kono, J. and Masuda, T. Efficient RMI: Dynamic specialization of object serialization. In Proceedings of the 20th International Conference on Distributed Computing Systems, Taipei, Taiwan, IEEE Computer Society Press, 2000, pp. 308-315.

    Google Scholar 

  27. Lawall, J. Faster Fourier transforms via automatic program specialization. In Partial Evaluation—Practice and Theory; Proceedings of the 1998 DIKU Summer School, J. Hatcliff, T.A. Mogensen, and P. Thiemann (Eds.), vol. 1706 of Lecture Notes in Computer Science. Springer-Verlag, Copenhagen, Denmark, 1998, pp. 338-355.

    Google Scholar 

  28. Le Meur, A.-F., Consel, C., and Escrig, B. An environment for building customizable software components. In IFIP/ACM Conference on Component Deployment. Berlin, Germany, 2002, pp. 1-14.

  29. Lee, P. and Leone, M. Optimizing ML with run-time code generation. In PLDI'96 [36], ACM SIGPLAN Notices, vol. 31,no. 5, 1996, pp. 137-148.

    Google Scholar 

  30. Marlet, R., Thibault, S., and Consel, C. Efficient implementations of software architectures via partial evaluation. Journal of Automated Software Engineering, 6(4) (1999) 411-440.

    Google Scholar 

  31. McCanne, S. and Jacobson, V. The BSD packet filter: A new architecture for user-level packet capture. In Proceedings of the Winter 1993 USENIX Conference. USENIX, San Diego, CA, USA, 1993, pp. 259-269.

    Google Scholar 

  32. McNamee, D., Walpole, J., Pu, C., Cowan, C., Krasic, C., Goel, C., Consel, C., Muller, G., and Marlet, R. Specialization tools and techniques for systematic optimization of system software. ACM Transactions on Computer Systems, 19 (2001) 217-251.

    Google Scholar 

  33. Muller, G., Marlet, R., Volanschi, E., Consel, C., Pu, C., and Goel, A. Fast, optimized Sun RPC using automatic program specialization. In Proceedings of the 18th International Conference on Distributed Computing Systems. IEEE Computer Society Press, Amsterdam, The Netherlands, 1998.

    Google Scholar 

  34. Muller, G., Volanschi, E., and Marlet, R. Scaling up partial evaluation for optimizing the Sun commercial RPC protocol. In ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation. ACM Press, 1997, pp. 116-125.

  35. PEPM'02. ACM SIGPLAN workshop on partial evaluation and semantics-based program manipulation. ACM Press, Portland, OR, USA, 2002.

  36. PLDI'96. Proceedings of the ACM SIGPLAN '96 conference on programming language design and implementation. Philadelphia, PA, USA, ACM SIGPLAN Notices, vol. 31,no. 5, 1996.

  37. Ryder, B. A position paper on compile-time program analysis. ACM SIGPLAN Notices, 32(1) (1997) 110-114.

    Google Scholar 

  38. Schultz, U., Lawall, J., Consel, C., and Muller, G. Towards automatic specialization of Java programs. In Proceedings of the European Conference on Object-oriented Programming (ECOOP'99), vol. 1628 of Lecture Notes in Computer Science. Lisbon, Portugal, 1999, pp. 367-390.

  39. Sperber, M. and Thiemann, P. The essence of LR parsing. In ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation. ACM Press, La Jolla, CA, USA, 1995, pp. 146-155.

    Google Scholar 

  40. Sun Microsystems. Network programming guide. Sun Microsystems, 1990.

  41. Taha, W. Multi-stage programming: Its theory and applications. Ph.D. thesis, Oregon Graduate Institute of Science and Technology, 1999.

  42. Thibault, S. and Consel, C. A framework for application generator design. In Proceedings of the Symposium on Software Reusability. Boston, MA, USA, 1997.

  43. Thibault, S., Consel, C., Marlet, R., Muller, G., and Lawall, J. Static and dynamic program compilation by interpreter specialization. Higher-Order and Symbolic Computation, 13(3) (2000) 161-178.

    Google Scholar 

  44. Thibault, S., Consel, C., and Muller, G. Safe and efficient active network programming. In 17th IEEE Symposium on Reliable Distributed Systems. West Lafayette, Indiana, 1998, pp. 135-143.

  45. Volanschi, E., Consel, C., Muller, G., and Cowan, C. Declarative specialization of object-oriented programs. In OOPSLA'97 Conference Proceedings. ACM Press, Atlanta, GA, USA, 1997, pp. 286-300.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Le Meur, AF., Lawall, J.L. & Consel, C. Specialization Scenarios: A Pragmatic Approach to Declaring Program Specialization. Higher-Order and Symbolic Computation 17, 47–92 (2004). https://doi.org/10.1023/B:LISP.0000029448.02877.78

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/B:LISP.0000029448.02877.78

Navigation