Abstract
The notion of flexibility (that is, the ability to adapt to changing requirements or execution contexts) is recognized as a key concern in structuring software, and many architectures have been designed to that effect. However, the corresponding implementations often come with performance and code size overheads. The source of inefficiency can be identified to be in the loose integration of components, because flexibility is often present not only at the design level but also in the implementation. To solve this flexibility vs. efficiency dilemma, we advocate the use of partial evaluation, which is an automated technique to produce efficient, specialized instances of generic programs. As supporting case studies, we consider several flexible mechanisms commonly found in software architectures: selective broadcast, pattern matching, interpreters, software layers, and generic libraries. Using Tempo, our specializer for C, we show how partial evaluation can safely optimize implementations of those mechanisms. Because this optimization is automatic, it preserves the original genericity and extensibility of the implementation.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Andersen, L.O. 1994. Program Analysis and Specialization for the C Programming Language. Ph.D. thesis, Computer Science Department, University of Copenhagen. DIKU Technical Report 94/19.
Andersen, L.O. and Gomard, C.K. 1992. Speedup analysis in partial evaluation: preliminary results. In Partial Evaluation and Semantics-Based Program Manipulation, San Francisco, CA, USA Technical Report YALEU/DCS/RR-909, Yale University, New Haven, CT, USA pp. 1-7.
Bach Maurice, J. 1986. The Design of the UNIX Operating System, Software Series. Prentice Hall, chap. 5, pp. 111-119.
Batory, D. and Geraci, B. 1997. Composition validation and subjectivity in Gen Voca generators. IEEE Transactions on Software Engineering, 23(2):67-82.
Batory, D., Singhal, V., Sirkin, M., and Thomas, J. 1993. Scalable Software Libraries. In Proceedings of the ACM SIGSOFT'93 Symposium on the Foundations of Software Engineering, pp. 191-199.
Bergstra, J.A. and Klint, P. 1996. The ToolBus coordination architecture. In (Hankin, C. 1996. Editors. Proceedings of the 1st International Conference on Coordination Languages and Models, Cesena, Italy, number 1061 in LNCS. Springer-Verlag Ciancarini and Hankin, 1996) pp. 75-88.
Bershad, B.N., Savage, S., Pardyak, P., Gün Sirer, E., Fiuczynski, M.E., Becker, D., Chambers, C., and Eggers, S. 1995. Extensibility, safety and performance in the SPIN operating system. In SOSP'95 (Proceedings of the 1995 ACM Symposium on Operating Systems Principles, Copper Mountain Resort, CO, USA, December 1995. ACM Operating Systems Reviews, ACM Press Vol. 29No. 5.) pp. 267-283.
Booch, G. 1990. The design of the C++ booch components. OOPSLA ECOOP'90 Proceedings, N. Meyrowitz (editor) ACM SIGPLAN Notices, 25(10):1-11, 1990.
Chambers, C., Eggers, S., Auslander, J., Philipose, M., Mok, M., and Pardyak, P. 1996. Automatic dynamic compilation support for event dispatching in extensible systems. In WCSSS'96 (Workshop on Compiler Support for Systems Software, Tucson, AZ, USA, February 1996.) pp. 118-126.
Chirokoff, S. and Consel, C. 1999. Combining program and data specialization. In PEPM'99 (ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, San Antonio, TX, USA, January 1999. ACM Press.) pp. 45-59.
Chorus. Chorus kernel v3 r5 implementation guide. Technical Report CS/TR-94-73.1, Chorus Systemes, 1994.
Ciancarini, P. and Hankin, C. 1996. Editors. Proceedings of the 1st International Conference on Coordination Languages and Models, Cesena, Italy, number 1061 in LNCS. Springer-Verlag.
Consel, C. and Danvy, O. 1989. Partial evaluation of pattern matching in strings. Information Processing Letters, 30(2):79-86.
Consel, C. and Danvy, O. 1991. 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.
Consel, C. and Danvy, O. 1993. Tutorial notes on partial evaluation. In Conference Record of the Twentieth Annual ACM SIGPLAN-SIGACT Symposium on Principles Of Programming Languages, Charleston, SC, USA ACM Press, pp. 493-501.
Consel, C., Hornof, L., Lawall, J., Marlet, R., Muller, G., Noyé, J., Thibault, S., and Volanschi, N. 1998. Tempo: Specializing systems applications and beyond. ACM Computing Surveys, Symposium on Partial Evaluation, 30(3).
Consel, C., Hornof, L., Noël, F., Noyé, J., and Volanschi, E.N. 1996. A uniform approach for compile-time and run-time specialization. In (Glück, R., and Thiemann, P. Editors. 1996. Partial Evaluation, International Seminar, Dagstuhl Castle, number 1110 in Lecture Notes in Computer Science Danvy et al., 1996) pp. 54-72.
Consel, C. and Khoo, S.C. 1993. Parameterized partial evaluation. ACM Transactions on Programming Languages and Systems, 15(3):463-493, Extended version of (Consel and Khoo, 1991).
Consel, C. and Khoo, S.C. 1991. Parameterized partial evaluation. In Proceedings of the ACM SIGPLAN '91 Conference on Programming Language Design and Implementation, Toronto, Ontario, Canada, ACM SIGPLAN Notices, 26(6) 92-106.
Consel, C. and Marlet, R. 1998. Architecturing software using a methodology for language development. In C. Palamidessi, H. Glaser, and K. Meinke, editors, Proceedings of the 10th International Symposium on Programming Language Implementation and Logic Programming, Pisa, Italy, number 1490 in Lecture Notes in Computer Science, pp. 170-194.
Consel, C. and Noël, F. 1996. A general approach for run-time specialization and its application to C. In POPL'96 (Conference Record of the 23rd Annual ACM SIGPLAN-SIGACT Symposium on Principles Of Programming Languages, St. Petersburg Beach, FL, USA, January 1996. ACM Press.) pp. 145-156.
Consel, C. 1996. Program adaptation based on program transformation. ACM Computing Surveys, 28(4): 164-167.
Danvy, O. 1991. Semantics-directed compilation of non-linear patterns. Information Processing Letters, 37:315-322.
Danvy, O., Glück, R., and Thiemann, P. Editors. 1996. Partial Evaluation, International Seminar, Dagstuhl Castle, number 1110 in Lecture Notes in Computer Science.
Dean, J., Grove, D., and Chambers, C. 1995. Optimization of object-oriented programs using static class hierarchy analysis. In Proceedings of ECOOP'95, Aarhus, Denmark, Springer-Verlag.
Eide, E., Frei, K., Ford, B., Lepreau, J., and Lindstrom, G. 1997. Flick: A flexible, optimizing IDL compiler. In Proceedings of the ACM SIGPLAN'97 Conference on Programming Language Design and Implementation, Las Vegas, Nevada, June 15–18, pp. 44-56.
Engler, D.R., Hsieh, W.C., and Kaashoek, M.F. 1996. 'C: A language for high-level, efficient, and machine-independent dynamic code generation. In POPL'96 (Conference Record of the 23rd Annual ACM SIGPLAN-SIGACT Symposium on Principles Of Programming Languages, St. Petersburg Beach, FL, USA, January 1996. ACM Press.) pp. 131-144.
Engler, D.R., Kaashoek, M.F., and O'Toole, J.W. 1995. Exokernel: An operating system architecture for application-level resource management. In SOSP'95 (Proceedings of the 1995 ACM Symposium on Operating Systems Principles, Copper Mountain Resort, CO, USA, December 1995. ACM Operating Systems Reviews, ACM Press Vol. 29No. 5.) pp. 251-266.
Futamura, Y., Nogi, K., and Takano, A. 1991. Essence of generalized partial computation. J. Theoretical Computer Science, 90:60-79.
Gamma, E., Helm, R., Johnson, R., and Vlissides, J. 1995. Design Patterns. Addison-Wesley.
Garlan, D., Kaiser, G.E., and Notkin, D. 1992. Using tool abstraction to compose systems. IEEE Journal Computer, 25(6):30-38.
Grant, B., Mock, M., Philipose, M., Chambers, C., and Eggers, S.J. 1997. Annotation-directed run-time specialization in C. In PEPM'97 (ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, Amsterdam, The Netherlands, June 1997. ACM Press.) pp. 163-178.
Hornof, L. and Jim, T. 1999. Certifying compilation and run-time code generation. In PEPM'99 (ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, San Antonio, TX, USA, January 1999. ACM Press.) pp. 60-74.
ISO 1988. Specification of abstract syntax notation one (ASN.1). ISO standard 8824.
Jacobs, I., Bertot, J., Montagnac, F., and Clement, D. 1993. The SOPHTALK reference manual. Technical Report RT 150, INRIA.
Jones, N.D. 1996. What not to do when writing an interpreter for specialisation. In Danvy et al. (Danvy, O., Glück, R. and Thiemann, P. editors. 1996. Partial Evaluation, International Seminar, Dagstuhl Castle, number 1110 in Lecture Notes in Computer Science.) pp. 216-237.
Jones, N.D., Gomard, C., and Sestoft, P. 1993. Partial Evaluation and Automatic Program Generation. International Series in Computer Science. Prentice-Hall.
Kamin, S. 1997. 1st ACM-SIGPLAN Workshop on Domain-Specific Languages, Paris, France, January 1997. Technical Report, Department of Computer Science, University of Illinois at Urbana-Champaign.
Karsai, G., Misra, A., Sztipanovits, J., Ledeczi, A., and Moore, M. 1997. Model-integrated system development: Models, architecture, and process. In Proceedings of the Computer Software and Applications Conference (COMPSAC), Bethesda, MA, pp. 176-181.
Khoo, S.C. and Sundaresh, R.S. 1991. Compiling inheritance using partial evaluation. In PEPM'91 (Partial Evaluation and Semantics-Based Program Manipulation, New Haven, CT, USA, September 1991. ACM SIGPLAN Notices, 26(9).) 26(9) 211-222.
Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., Loingtier, J.-M., and Irwin, J. 1997. Aspect-oriented programming. In M. Aksit and S. Matsuoka, editors, Proceedings of the European Conference on Object-oriented Programming (ECOOP'97), Vol. 1241 of Lecture Notes in Computer Science, Jyväskylä, Finland, Springer, pp. 220-242.
Kieburtz, R., Bellegarde, F., Bell, J., Hook, J., Lewis, J., Oliva, D., Sheard, T., Walton, L., and Zhou, T. 1995. Calculating software generators from solution specifications. In Theory and Practice of Software Development (TAPSOFT), Vol. 915 of LNCS, Springer-Verlag, pp. 546-560.
Knoblock, T.B. and Ruf, E. 1996. Data specialization. In PLDI'96 (Proceedings of the ACM SIGPLAN'96 Conference on Programming Language Design and Implementation, Philadelphia, PA, May 1996. ACM SIGPLAN Notices, 31(5).) pp. 215-225. Also TR MSR-TR-96-04, Microsoft Research.
Lee, P. and Leone, M. 1996. Optimizing ML with run-time code generation. In PLDI'96 (Proceedings of the ACM SIGPLAN'96 Conference on Programming Language Design and Implementation, Philadelphia, PA, May 1996. ACM SIGPLAN Notices, 31(5).) pp. 137-148.
Locanthi, B.N. 1987. Fast bitblt() with asm() and cpp. In European UNIX Systems User Group Conference Proceedings, AT&T Bell Laboratories, Murray Hill, EUUG, pp. 243-259.
McClain, G.R. 1991. Open Systems Interconnection Handbook. Intertext Publications, McGraw-Hill, New York.
Montz, A.B., Mosberger, D., O'Malley, S.W., Peterson, L.L., Proebsting, T.A., and Hartman, J.H. 1994. Scout: A communications-oriented operating system. Technical Report 94-20, Department of Computer Science, The University of Arizona, 1994.
Muller, G., Marlet, R., Volanschi, E.N., Consel, C., Pu, C., and Goel, A. 1998. 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, pp. 240-249.
Muller, G., Volanschi, E.N., and Marlet, R. 1997. Scaling up partial evaluation for optimizing the Sun commercial RPC protocol. In PEPM'97 (ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, Amsterdam, The Netherlands, June 1997. ACM Press.) pp. 116-125.
Noël, F., Hornof, L., Consel, C., and Lawall, J. 1998. Automatic, template-based run-time specialization: Implementation and experimental study. In International Conference on Computer Languages, Chicago, IL, IEEE Computer Society Press, pp. 132-142. Also available as IRISA report PI-1065.
OMG 1995. CORBA: The Common Object Request Broker. Architecture and Specification. Framingham.
Ousterhout, J.K. 1998. Scripting: Higher-level programming for the 21st century. IEEE Computer, 31(3): 23-30.
Proebsting, T.A. and Watterson, S.A. 1996. Filter fusion. In POPL'96 (Conference Record of the 23rd Annual ACM SIGPLAN-SIGACT Symposium on Principles Of Programming Languages, St. Petersburg Beach, FL, USA, January 1996. ACM Press.) pp. 119-130.
Pu, C., Autrey, T., Black, A., Consel, C., Cowan, C., Inouye, J., Kethana, L., Walpole, J., and Zhang, K. 1995. Optimistic incremental specialization: Streamlining a commercial operating system. In SOSP'95 (Proceedings of the 1995 ACM Symposium on Operating Systems Principles, Copper Mountain Resort, CO, USA, December 1995. ACM Operating Systems Reviews, ACM Press, Vol. 29,No. 5.) pp. 314-324.
Pu, C., Massalin, H., and Ioannidis, J. 1988. The Synthesis kernel. Computing Systems, 1(1):11-32.
Ramming, C. 1997. Conference on Domain-Specific Languages, Santa Barbara, CA, October 1997. Usenix.
Reiss, S.P. 1990. Connecting tools using message passing in the Field environment. IEEE Software, 7(4):57-66.
Schultz, U., Lawall, J., Consel, C., and Muller, G. 1999. Towards automatic specialization of Java programs. In Proceedings of the European Conference on Object-oriented Programming (ECOOP'99), Lisbon, Portugal, pp. 367-390.
Shaw, M. and Garlan, D. 1996. Software Architecture. Prentice Hall.
Smith, D.A., Partial evaluation of pattern matching in CLP domains. In PEPM'91 (Partial Evaluation and Semantics-Based Program Manipulation, New Haven, CT, USA, September 1991. ACM SIGPLAN Notices, 26(9).) ACM SIGPLAN Notices, 26(9):62-71.
Snodgrass, R. 1989. The Interface Definition Language: Definition and Use. Computer Science Press, Rockville, MD.
Stewart, D.R. 1992. MESCHACH: Matrix Computations in C. University of Canberra, Australia, Documentation of MESCHACH Version 1.0.
Stickel, M., Waldinger, R., Lowry, M., and Pressburger, T. 1994. Deductive composition of astronomical software from subroutine libraries. In Twelfth International Conference on Automated Deduction (CADE), Vol. 814 of LNCS, Nancy, France, pp. 341-355.
Taha, W. and Sheard, T., Multi-state programming with explicit annotations. In PEPM'97 (ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, Amsterdam, The Netherlands, June 1997. ACM Press.) pp. 203-217.
Thibault, S. and Consel, C. 1997. A framework of application generator design. In M. Harandi, editor, Proceedings of the Symposium on Software Reusability, Boston, Massachusetts, USA, Software Engineering Notes, 22(3), pp. 131-135.
Thibault, S., Consel, C., and Muller, G. 1998. Safe and efficient active network programming. In 17th IEEE Symposium on Reliable Distributed Systems, West Lafayette, Indiana, pp. 135-143.
Thibault, S., Marlet, R., and Consel, C. 1997. A domain-specific language for video device drivers: from design to implementation. In DSL'97 (Conference on Domain Specific Languages, Santa Barbara, CA, October 1997. Usenix.) pp. 11-26.
Veldhuizen, T.L. 1998. Arrays in Blitz++. In Proceedings of the International Symposium on Computing in Object-Oriented Parallel Environments, number 1505 in Lecture Notes in Computer Science, Santa Fe, New Mexico. Springer-Verlag.
Volanschi, E.N., Consel, C., Muller, G., and Cowan, C. 1997. Declarative specialization of object-oriented programs. In OOPSLA'97 Conference Proceedings, ACM Press, pp. 286-300, Atlanta, USA.
Volanschi, E.N., Muller, G., Consel, C., Hornof, L., Noyé, J., and Pu. C. 1996. A uniform and automatic approach to copy elimination in system extensions via program specialization. Research Report 2903, INRIA, Rennes, France.
Wadler Philip 1990. Deforestation: transforming programs to eliminate trees. Theoretical Computer Science, 73:231-248.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Marlet, R., Thibault, S. & Consel, C. Efficient Implementations of Software Architectures via Partial Evaluation. Automated Software Engineering 6, 411–440 (1999). https://doi.org/10.1023/A:1008719607040
Issue Date:
DOI: https://doi.org/10.1023/A:1008719607040