This Article 
 Bibliographic References 
 Add to: 
Interface Compilation: Steps Toward Compiling Program Interfaces as Languages
May/June 1999 (vol. 25 no. 3)
pp. 387-400

Abstract—Interfaces—the collection of procedures and data structures that define a library, a subsystem, a module—are syntactically poor programming languages. They have state (defined both by the interface's data structures and internally), operations on this state (defined by the interface's procedures), and semantics associated with these operations. Given a way to incorporate interface semantics into compilation, interfaces can be compiled in the same manner as traditional languages such as ANSI C or FORTRAN. This paper makes two contributions. First, it proposes and explores the metaphor of interface compilation, and provides the beginnings of a programming methodology for exploiting it. Second, it presents Magik, a system built to support interface compilation. Using Magik, software developers can build optimizers and checkers for their interface languages, and have these extensions incorporated into compilation, with a corresponding gain in efficiency and safety. This organization contrasts with traditional compilation, which relegates programmers to the role of passive consumers, rather than active exploiters of a compiler's transformational abilities.

[1] S.P. Amarasinghe, J.M. Anderson, M.S. Lam, and A.W. Lim, "An Overview of a Compiler for Scalable Parallel Machines," Proc. Sixth Workshop Languages and Compilers for Parallel Computing, pp. 253-272,Portland, Ore., Aug. 1993.
[2] M Bishop and M. Dilger, “Checking for Race Conditions in File Accesses,” Computing Systems, pp. 131–152, Spring 1996.
[3] S. Chiba, “Open C++ Programmer's Guide,” Technical Report TR93-93-3, Dept. of Information Science, Univ. of Tokyo, 1993.
[4] S. Chiba, “A Metaobject Protocol for C++,” Proc. OOPSLA '95, pp. 285–299, ACM, 1995.
[5] D.R. Engler, W.C. Hsieh, and M.F. Kaashoek, “`C: A Language for High-Level, Efficient, and Machine-Independent Dynamic Code Generation,” Proc. 23rd ACM SIGPLAN Symp. Principles of Programming Languages (POPL), pp. 131-144, Jan. 1996.
[6] C. Fraser and D. Hanson, A Retargetable C Compiler: Design and Implementation, Benjamin/Cummings Publishing, Redwood City, Calif., 1995; .
[7] C.W. Fraser and D.R. Hanson, “A Code Generation Interface for ANSI C. Software—Practice and Experience, vol. 21, no. 9, pp. 963–988, Sept. 1991.
[8] W. Wilson Ho and R.A. Olsson, “An Approach to Genuine Dynamic Linking,” Software—Practice and Experience, vol. 24, no. 4, pp. 375–390, Apr. 1991.
[9] C.L. Jeffery and R.E. Griswold, “A Framework for Execution Monitoring in Icon,” Software—Practice and Experience vol. 24, no. 11, pp. 1,025–1,049, Nov. 1994.
[10] G. Kiczales, J. des Rivières, and D. Bobrow, The Art of the Metaobject Protocol. MIT Press, 1991.
[11] G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C. Videira Lopes, J.-M. Loingtier, and J. Irwin, “Aspect-Oriented Programming,” Proc. European Conf. Object-Oriented Programming (ECOOP), June 1997.
[12] A. Kolawa and A. Hicken, “Insure++: A Tool to Support Total Quality Software,”
[13] T. Lord, “Application Specific Static Code Checking for C Programs: Ctool,” twaddle: A Digital Zine (version 1.0), 1997.
[14] T.C. Mowry, A.K. Demke, and O. Krieger, “Automatic Compiler-Inserted I/O Prefetching for Out-of-Core Applications,” Proc. Second Symp. Operating Systems Design and plementation (OSDI '96), Nov. 1996.
[15] A. Srivastava and D.W. Wall, “A Practical System for Intermodule Code Optimization at Link-Time,” J. Programming Languages, Mar. 1992.
[16] A. Srivastava and A. Eustace, "ATOM: A System for Building Customized Program Analysis Tools," Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, ACM Press, New York, 1994.
[17] M.T. Vandevoorde, “Exploiting Specifications to Improve Program Performance,” PhD thesis, MIT, 1994.
[18] M.T. Vandevoorde and J.V. Guttag, “Using Specialized Procedures and Specification-Based Analysis to Reduce the Runtime Costs of Modularity, Proc. 1994 ACM/SIGSOFT Foundations of Software Eng. Conf., 1994.
[19] R. Wahbe, S. Lucco, T. Anderson, and S. Graham, Efficient Software-Based Fault Isolation Proc. 14th ACM Symp. Operating System Principles, pp. 203-216, Dec. 1993.
[20] D.W. Wall, “Systems for Late Code Modification,” Proc. Workshop on Code Generation, CODE'91, 1991.
[21] D. Weise and R. Crew, “Programmable Syntax Macros,” Proc. PLDI'93, pp. 156–165, Albuquerque, New Mexico, June 1993.

Index Terms:
Interface compilation, programming methodology, high-level languages, compiler optimization, interface checking, interface optimization.
Dawson R. Engler, "Interface Compilation: Steps Toward Compiling Program Interfaces as Languages," IEEE Transactions on Software Engineering, vol. 25, no. 3, pp. 387-400, May-June 1999, doi:10.1109/32.798327
Usage of this product signifies your acceptance of the Terms of Use.