Abstract
When writing a program generator requires considerable intellectual effort,it is pleasant to amortize that effort by using the generator to build more than one application. When a program generator serves multiple clients,however, the implementor must address pragmatic questions that implementors of single-use program generators can ignore. In how many languages should generated code be written? How should code be packaged? What should the interfaces to the client code look like? How should a user control variations? This paper uses exam- ples from SLED, λ-RTL, and ASDL to elaborate on these questions. It is hoped that the paper will stimulate discussion and the development of better techniques. Most urgently needed is a simple, clear way to control interfaces to generated code.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Aho, Alfred V. and Steve C. Johnson. 1974 (June). LR parsing. Computing Surveys, 6(2):99–124.
Appel, Andrew W. and David B. MacQueen. 1991 (August). Standard ML of New Jersey. In Wirsing, Martin, editor, Third Int’l Symp. on Prog. Lang. Implementation and Logic Programming, pages 1–13, New York.
Auslander, Joel, Matthai Philipose, Craig Chambers, Susan Eggers, and Brian Bershad. 1996 (May). Fast, effective dynamic compilation. Proceedings of the ACM SIGPLAN ’96 Conference on Programming Language Design and Implementation, in SIGPLAN Notices, 31(5):149–159.
Baecker, Ronald M. and Aaron Marcus. 1990. Human Factors and Typography for More Readable Programs. Reading, MA: Addison-Wesley.
Benitez, Manuel E. and Jack W. Davidson. 1988 (July). A portable global optimizer and linker. Proceedings of the ACM SIGPLAN ’88 Conference on Programming Language Design and Implementation, in SIGPLAN Notices, 23(7):329–338.
Blaschek, Günther and Johannes Sametinger. 1989 (July). User-adaptable prettyprinting. Software-Practice & Experience, 19(7):687–702.
Braun, Owen C. 1996 (May). Retargetability issues in worst-case timing analysis of embedded systems. Bachelor’s thesis, Dept of Computer Science, Princeton University.
Bumbulis, Peter and Donald D. Cowan. 1993 (March). RE2C: A more versatile scanner generator. ACM Letters on Programming Languages and Systems, 2(4):70–84.
Cifuentes, Cristina, Mike van Emmerik, and Norman Ramsey. 1999 (October). The design of a resourceable and retargetable binary translator. In Proceedings of the Working Conference on Reverse Engineering (WCRE’99),pages 280–291. IEEE CS Press.
Davidson, J. W. and C. W. Fraser. 1984 (October). Code selection through object code optimization. ACM Transactions on Programming Languages and Systems, 6(4):505–526.
Dean, Jeffrey, Greg DeFouw, David Grove, Vassily Litvinov, and Craig Chambers. 1996 (October). Vortex: An optimizing compiler for object-oriented languages. OOPSLA ’96 Conference Proceedings, in SIGPLAN Notices, 31(10):83–100.
DeRemer, Frank and Thomas Pennello. 1982 (October). Efficient computation of LALR(1) look-ahead sets. ACM Transactions on Programming Languages and Systems, 4(4):615–649.
Derman, Emanuel and Christopher Van Wyk. 1984 (December). A simple equation solver and its application to financial modelling. Software-Practice & Experience, 14(12):1169–1181.
Engler, Dawson R. 1996 (May). VCODE: a retargetable, extensible, very fast dynamic code generation system. Proceedings of the ACM SIGPLAN ’96 Conference on Programming Language Design and Implementation, in SIGPLAN Notices, 31(5):160–170.
Fernández, Mary F. 1995 (June). Simple and effective link-time optimization of Modula-3 programs. Proceedings of the ACM SIGPLAN ’95 Conference on Programming Language Design and Implementation, in SIGPLAN Notices, 30(6):103–115.
Fraser, Christopher W. and David R. Hanson. 1995. A Retargetable C Compiler: Design and Implementation. Redwood City,CA: Benjamin/Cummings.
Fraser, Christopher W., Robert R. Henry, and Todd A. Proebsting. 1992 (April). BURG-fast optimal instruction selection and tree parsing. SIGPLAN Notices, 27(4):68–76.
Gray, Robert W. 1988 (June). γ-GLA: A generator for lexical analyzers that programmers can use. In Proceedings of the Summer USENIX Conference, pages 147–160, Berkeley, CA, USA.
Griswold, Ralph E. and Madge T. Griswold. 1996. The Icon Programming Language. Third edition. San Jose, CA: Peer-to-Peer Communications.
Hanson, David R. 1996. C Interfaces and Implementations. Benjamin/Cummings. —. 1999 (April). Early experience with ASDL in lcc. Software-Practice & Experience, 29(5):417–435. See also Technical Report MSR-TR-98-50, Microsoft Research.
Hughes, John. 1995. The design of a pretty-printing library. In Jeuring, J. and E. Meijer, editors, Advanced Functional Programming, Vol. 925 of LNCL. Springer Verlag.
Hunt, Andrew and David Thomas. 1999. The Pragmatic Programmer: From Journeyman to Master. Reading, MA: Addison-Wesley.
Johnson, Steve C. 1975. Yacc-yet another compiler compiler. Technical Report 32, Computer Science, AT&T Bell Laboratories, Murray Hill, New Jersey.
Larus, James R. and Eric Schnarr. 1995 (June). EEL: machine-independent executable editing. Proceedings of the ACM SIGPLAN ’95 Conference on Programming Language Design and Implementation, in SIGPLAN Notices, 30(6):291–300.
Lee, Peter and Mark Leone. 1996 (May). Optimizing ML with run-time code generation. Proceedings of the ACM SIGPLAN ’96 Conference on Programming Language Design and Implementation, in SIGPLAN Notices, 31(5):137–148.
Lesk, M. E. and E. Schmidt. 1975. Lex-A lexical analyzer generator. Computer Science Technical Report 39, Bell Laboratories, Murray Hill, NJ.
Liskov, Barbara and John Guttag. 1986. Abstraction and Specification in Program Development. MIT Press / McGraw-Hill.
Nielsen, Jakob. 1993. Usability Engineering. Boston, MA: Academic Press.
Odersky, Martin and Philip Wadler. 1997. Pizza into Java: Translating theory into practice. In Conference Record of the 24th Annual ACM Symposium on Principles of Programming Languages, pages 146–159. ACM SIGACT and SIGPLAN, ACM Press.
Oppen, Derek C. 1980 (October). Prettyprinting. ACM Transactions on Programming Languages and Systems, 2(4):465–483.
Proebsting, Todd A. 1992 (June). Simple and efficient BURS table generation. Proceedings of the ACM SIGPLAN ’92 Conference on Programming Language Design and Implementation, in SIGPLAN Notices, 27(6):331–340.
Pugh, William W. and Steven J. Sinofsky. 1987 (January). A new language-independent prettyprinting algorithm. Technical Report TR 87-808,Cornell University.
Ramsey, Norman. 1994 (January). Correctness of trap-based breakpoint implementations. In Proceedings of the 21st ACM Symposium on the Principles of Programming Languages, pages 15–24, Portland, OR. —. 1996 (April). A simple solver for linear equations containing nonlinear operators. Software-Practice & Experience, 26(4):467–487.
Ramsey, Norman and Jack W. Davidson. 1998 (June). Machine descriptions to build tools for embedded systems. In ACM SIGPLAN Workshop on Languages, Compilers, and Tools for Embedded Systems (LCTES’98), Vol. 1474 of LNCL, pages 172–188. Springer Verlag. —. 1999 (December). Specifying instructions’ semantics using λ-RTL (interim report). See http://www.cs.virginia.edu/zephyr/csdl/lrtlindex.html.
Ramsey, Norman and Mary F. Fernández. 1995 (January). The New Jersey Machine-Code Toolkit. In Proceedings of the 1995 USENIX Technical Conference, pages 289–302, New Orleans,LA.
Ramsey, Norman and David R. Hanson. 1992 (July). A retargetable debugger. ACM SIGPLAN ’92 Conference on Programming Language Design and Implementation, in SIGPLAN Notices, 27(7):22–31.
Stallman, Richard M. 1992 (February). Using and Porting GNU CC (Version 2.0). Free Software Foundation.
Steele, Jr., Guy L. 1994. Building interpreters by composing monads. In ACM, editor, Conference Record of the 21st Annual ACM Symposium on Principles of Programming Languages, pages 472–492, New York, NY, USA.
Thiemann, Peter. 2000 (January). Modeling HTML in Haskell. In Pontelli, Enrico and Vítor Santos Costa, editors, Practical Aspects of Declarative Languages (PADL 2000), Vol. 1753 of LNCL, pages 263–277. Berlin: Springer.
Wadler, Philip. 1999. A prettier printer. Unpublished note available from the author’s Web site.
Waite, William M. 1986 (May). The cost of lexical analysis. Software-Practice & Experience, 16(5):473–488.
Wang, Daniel C., Andrew W. Appel, Je. L. Korn, and Christopher S. Serra. 1997 (October). The Zephyr Abstract Syntax Description Language. In Proceedings of the 2nd USENIX Conference on Domain-Specific Languages, pages 213–227, Santa Barbara, CA.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2000 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Ramsey, N. (2000). Pragmatic Aspects of Reusable Program Generators Position Paper. In: Taha, W. (eds) Semantics, Applications, and Implementation of Program Generation. SAIG 2000. Lecture Notes in Computer Science, vol 1924. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45350-4_12
Download citation
DOI: https://doi.org/10.1007/3-540-45350-4_12
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-41054-6
Online ISBN: 978-3-540-45350-5
eBook Packages: Springer Book Archive