Skip to main content
Log in

Static and Dynamic Program Compilation by Interpreter Specialization

  • Published:
Higher-Order and Symbolic Computation

Abstract

Interpretation and run-time compilation techniques are increasingly important because they can support heterogeneous architectures, evolving programming languages, and dynamically-loaded code. Interpretation is simple to implement, but yields poor performance. Run-time compilation yields better performance, but is costly to implement. One way to preserve simplicity but obtain good performance is to apply program specialization to an interpreter in order to generate an efficient implementation of the program automatically. Such specialization can be carried out at both compile time and run time.

Recent advances in program-specialization technology have significantly improved the performance of specialized interpreters. This paper presents and assesses experiments applying program specialization to both bytecode and structured-language interpreters. The results show that for some general-purpose bytecode languages, specialization of an interpreter can yield speedups of up to a factor of four, while specializing certain structured-language interpreters can yield performance comparable to that of an implementation in a general-purpose language, compiled using an optimizing compiler.

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

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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

Instant access to the full article PDF.

Similar content being viewed by others

References

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

  2. Arnold, B.R.T., van Deursen, A., and Res, M. An algebraic specification of a language for describing financial products. In ICSE-17 Workshop on Formal Methods Application in Software Engineering, April 1995, pp. 6–13.

  3. Auslander, J., Philipose, M., Chambers, C., Eggers, S., and Bershad, B.N. Fast, effective dynamic compilation. In Proceedings of the ACMSIGPLAN '96 Conference on Programming Language Design and Implementation, Philadelphia, PA, May 1996, pp. 149–159. ACM SIGPLAN Notices, 31(5).

    Google Scholar 

  4. Bondorf, A. and Palsberg, J. Generating action compilers by partial evaluation. Journal of Functional Programming, 6(2) (1996) 269–298.

    Google Scholar 

  5. Conference on Domain Specific Languages, Santa Barbara, CA, Usenix, Oct. 1997.

  6. Consel, C. and Danvy, O. Static and dynamic semantics processing. In Conference Record of the Eighteenth Annual ACM SIGPLAN-SIGACT Symposium on Principles Of Programming Languages, Orlando, FL, USA, ACM Press, Jan. 1991.

    Google Scholar 

  7. Consel, C. and Danvy, O. Tutorial notes on partial evaluation. In Conference Record of the Twentieth Annual ACMSIGPLAN-SIGACT Symposium on Principles Of Programming Languages, Charleston, SC, USA, ACM Press, Jan. 1993, pp. 493–501.

    Google Scholar 

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

    Google Scholar 

  9. Consel, C., Hornof, L., Lawall, J., Marlet, R., Muller, G., Noyé, J., Thibault, S., and Volanschi, N. Tempo: Specializing systems applications and beyond. ACM Computing Surveys, Symposium on Partial Evaluation, 30(3) (1998).

  10. Consel, C., Hornof, L., Noël, F., Noyé, J., and Volanschi, E.N. 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.). Feb. 1996, pp. 54–72. Lecture Notes in Computer Science, Vol. 1110.

  11. Consel, C. and Khoo, S.C. Semantics-directed generation of a Prolog compiler. In Proceedings of the 3rd International Symposium on Programming Language Implementation and Logic Programming, J. Maluszyński and M. Wirsing (Eds.). Passau, Germany, Aug. 1991, pp. 135–146. Lecture Notes in Computer Science, Vol. 528, Springer-Verlag.

  12. Consel, C. and Noál, F. A general approach for run-time specialization and its application to C. In Conference Record of the 23rd Annual ACM SIGPLAN-SIGACT Symposium on Principles Of Programming Languages, St. Petersburg Beach, FL, USA, ACM Press, Jan. 1996, pp. 145–156.

    Google Scholar 

  13. Engler, D.R. and Kaashoek, M.F. DPF: Fast, flexible message demultiplexing using dynamic code generation. In SIGCOMM Symposium on Communications Architectures and Protocols, Stanford University, CA, ACM Press, Aug. 1996, pp. 26–30.

    Google Scholar 

  14. Gosling, J., Joy, B., and Steele, G. The Java Language Specification. Addison-Wesley, 1996. ISBN 0-201-63451-1.

  15. Hicks, M., Kakkar, P., Moore, J.T., Gunter, C.A., and Nettles, S. PLAN: A packet language for active networks. In Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming Languages, ACM, June 1998, pp. 86–93. ACM SIGPLAN Notices, 34(1).

    Google Scholar 

  16. Hornof, L. and Jim, T. Certifying compilation and run-time code generation. Higher-Order and Symbolic Computation, 12(4) (1999) 337–376.

    Google Scholar 

  17. Hornof, L. and Noyé, J. Accurate binding-time analysis for imperative languages: Flow, context, and return sensitivity. In ACMSIGPLAN Symposium on Partial Evaluation and Semantics-Based ProgramManipulation, Amsterdam, The Netherlands, ACM Press, June 1997, pp. 63–73.

    Google Scholar 

  18. Hornof, L., Noyé, J., and Consel, C. Effective specialization of realistic programs via use sensitivity. In Lecture Notes in Computer Science, Vol. 1302: Proceedings of the Fourth International Symposium on Static Analysis, SAS'97, P. Van Hentenryck (Ed.), Paris, France. Springer-Verlag, Sept. 1997, pp. 293–314.

  19. Jones, N.D. Automatic program specialization: A re-examination from basic principles. In Partial Evaluation and Mixed Computation, D. Bjø rner, A.P. Ershov, and N.D. Jones (Eds.). North-Holland, 1988, pp. 225–282.

  20. Jones, N.D., Gomard, C., and Sestoft, P. Partial Evaluation and Automatic ProgramGeneration. Prentice-Hall, June 1993. International Series in Computer Science.

  21. Khoo, S.C. and Sundaresh, R.S. Compiling inheritance using partial evaluation. In Partial Evaluation and Semantics-Based Program Manipulation, New Haven, CT, USA, Sept. 1991, pp. 211–222. ACM SIGPLAN Notices, 26(9).

    Google Scholar 

  22. Ladd, D. and Ramming, C. Two application languages in software production. In USENIX Symposium on Very High Level Languages, New Mexico, Oct. 1994.

  23. Ladd, D.A. and Ramming, J.C. Programming the Web: An application-oriented language for hypermedia service programming. In Fourth International World Wide Web Conference, Boston, Massachusetts, Dec. 1995.

  24. 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, San Diego, California, USA, USENIX, Jan. 1993, pp. 259–269.

    Google Scholar 

  25. Mogul, J.C., Rashid, R.F., and Accetta, M.J. The packet filter: An efficient mechanism for user-level network code. In The Proceedings of the 11th Symposium on Operating System Principles, Nov. 1987.

  26. Muller, G., Marlet, R., and Volanschi, E.N. Accurate program analyses for successful specialization of legacy system software. Theoretical Computer Science, 248(1–2) (2000). To appear in TCS Volume 248/1–2.

    Google Scholar 

  27. Muller, G., Marlet, R., Volanschi, E.N., 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, Amsterdam, The Netherlands, IEEE Computer Society Press, May 1998, pp. 240–249.

    Google Scholar 

  28. Muller, G., Moura, B., Bellard, F., and Consel, C. Harissa: A flexible and efficient Java environment mixing bytecode and compiled code. In Proceedings of the 3rd Conference on Object-Oriented Technologies and Systems, Portland, Oregon, USA, Usenix. June 1997, pp. 1–20.

    Google Scholar 

  29. Muller, G. and Schultz, U. Harissa: A hybrid approach to Java execution. IEEE Software, (1999) 44–51.

  30. Necula, G. and Lee, P. Safe kernel extensions without run-time checking. In Proceedings of the Second Symposium on Operating Systems Design and Implementation, Seattle, Washington, Oct. 1996, pp. 229–243.

  31. Noël, F., Hornof, L., Consel, C., and Lawall, J. Automatic, template-based run-time specialization: Implementation and experimental study. In International Conference on Computer Languages, Chicago, IL, IEEE Computer Society Press, May 1998, pp. 132–142. Also available as IRISA report PI-1065.

    Google Scholar 

  32. Piumarta, I. and Riccardi, F. Optimizing directed threaded code by selective inlining. In PLDI'98 [33], pp. 291–300.

  33. Proceedings of the ACM SIGPLAN'98 Conference on Programming Language Design and Implementation, Montreal, Canada, 17–19 June 1998.

  34. Schmidt, D.A. Denotational Semantics: a Methodology for Language Development. Allyn and Bacon, Inc., 1986.

  35. 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), Lisbon, Portugal, June 1999, pp. 367–390. Lecture Notes in Computer Science, Vol. 1628.

    Google Scholar 

  36. Taha, W., Benaissa, W., and Sheard, T. Multi-stage programming: Axiomatization and type safety. In Automata, Languages and Programming, 25th International Colloquium (ICALP'98), Aalborg, Denmark, July 1998, pp. 918–929. Lecture Notes in Computer Science, Vol. 1443.

    Google Scholar 

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

  38. Thibault, S., Marant, J., and Muller, G. Adapting distributed applications using extensible networks. In Proceedings of the 19th International Conference on Distributed Computing Systems, Austin, Texas, IEEE Computer Society Press, May 1999, pp. 234–243.

    Google Scholar 

  39. Thibault, S., Marlet, R., and Consel, C. Domain-specific languages: From design to implementation — Application to video device drivers generation. IEEE Transactions on Software Engineering, 25(3) (1999) 363–377.

    Google Scholar 

  40. Volanschi, E.N. An automatic approach to specializing system components. Ph.D. Thesis, Universitá de Rennes I, Feb. 1998.

  41. Wickline, P., Lee, P., and Pfenning, F. Run-time code generation and Modal-ML. In PLDI'98 [33], pp. 224–235.

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Thibault, S., Consel, C., Lawall, J.L. et al. Static and Dynamic Program Compilation by Interpreter Specialization. Higher-Order and Symbolic Computation 13, 161–178 (2000). https://doi.org/10.1023/A:1010078412711

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/A:1010078412711