XT An Annotated Bibliography

0 downloads 0 Views 133KB Size Report
May 31, 2003 - [pdf, ps.gz, ps.zip, bib] . .... pdf Utrecht University, July 2000. Imperative ... guson, Jonathan Gray, and Louise Scott, editors, Proceedings of the.
Stratego/XT An Annotated Bibliography Eelco Visser May 31, 2003

Introduction Stratego is a modular language for the specification of fully automatic program transformation systems based on the paradigm of rewriting strategies. This document presents an annotated bibliography of Stratego and closely related projects. The document is organized into sections each dealing with aspects such as language design, implementation and applications.

Overview A short overview of version 0.5 of the Stratego language and system is presented in [1]. The Stratego distribution and documentation are available from [2]. LaTeX Warning: There were undefined references. LaTeX Warning: There were multiply-defined labels. [1] E. Visser. Stratego: A language for program transformation based on rewriting strategies. System description of Stratego 0.5. In A. Middeldorp, editor, Rewriting Techniques and Applications (RTA’01), volume 2051 of Lecture Notes in Computer Science, pages 357–361. Springer-Verlag, May 2001. [pdf, ps.gz, ps.zip, bib] . [2] http://www.stratego-language.org.

Language Concepts The first ideas about programmable rewriting strategies supporting generic term traversal were developed in the algebraic specification formalism ASF+SDF [3]. That paper introduces the 2 (all) and 3 (one) traversal primitives, and their use in the definition of full term traversals such as bottomup, topdown, and innermost. The calculus of strategy operators is further developed and formalized using an operational semantics in [5]. Rewrite rules are no longer considered as primitives, but are broken down into the more basic actions of matching and building terms. This allows other combinations in which matching and term construction are used, including contextual rules and variable binding constructs used

1

in conditions. The calculus (System S) can be used as a core language to implement traditional rewriting languages and variations such as conditional rules and default rules [4]. The strategic programming idioms of contextual rules and recursive patterns are illustrated in [6] as well as the overlays language construct that allows abstraction over term patterns. Generic term (de)construction [7] supports the generic definition of program analyses such as free variable extraction. Scoped dynamic rewrite rules [8] overcome the limitations of the context-free nature of rewrite rules by supporting the generation of context-sensitive rewrite rules. Specification of transformation rules in the concrete syntax of the object language [9] closes the conceptual distance between the programs that we write and their representation in a transformation system. [3] Bas Luttik and Eelco Visser. Specification of rewriting strategies. In M. P. A. Sellink, editor, 2nd International Workshop on the Theory and Practice of Algebraic Specifications (ASF+SDF’97), Electronic Workshops in Computing, Berlin, November 1997. Springer-Verlag. [ps.gz, ps.zip] . [4] Eelco Visser and Zine-el-Abidine Benaissa. A core language for rewriting. In C. Kirchner and H. Kirchner, editors, Second International Workshop on Rewriting Logic and its Applications (WRLA’98), volume 15 of Electronic Notes in Theoretical Computer Science, Pont-`a-Mousson, France, September 1998. Elsevier Science Publishers. [ps.gz, ps.zip]. [5] Eelco Visser, Zine-el-Abidine Benaissa, and Andrew Tolmach. Building program optimizers with rewriting strategies. In Proceedings of the third ACM SIGPLAN International Conference on Functional Programming (ICFP’98), pages 13–26. ACM Press, September 1998. [ps.gz, ps.zip]. [6] Eelco Visser. Strategic pattern matching. In P. Narendran and M. Rusinowitch, editors, Rewriting Techniques and Applications (RTA’99), volume 1631 of Lecture Notes in Computer Science, pages 30–44, Trento, Italy, July 1999. Springer-Verlag. [ps.gz, ps.zip] . [7] Eelco Visser. Language independent traversals for program transformation. In Johan Jeuring, editor, Workshop on Generic Programming (WGP’00), Ponte de Lima, Portugal, July 2000. Technical Report UU-CS-2000-19, Department of Information and Computing Sciences, Universiteit Utrecht. [ps.gz, ps.zip] . [8] Eelco Visser. Scoped dynamic rewrite rules. In Mark van den Brand and Rakesh Verma, editors, Rule Based Programming (RULE’01), volume 59/4 of Electronic Notes in Theoretical Computer Science. Elsevier Science Publishers, September 2001. [ps.gz, ps.zip, pdf]. [9] Eelco Visser. Meta-programming with concrete object syntax. In Don Batory, Charles Consel, and Walid Taha, editors, Generative Programming and Component Engineering (GPCE’02), volume 2487 of Lecture Notes in Computer Science, pages 299–315, Pittsburgh, PA, USA, October 2002. Springer-Verlag. [pdf].

2

Transformation Infrastructure Transformation systems require more than transformation of abstract syntax trees. The XT bundle of program transformation tools [25] provides support for the construction of transformation systems from components. This includes tools for parsing and pretty-printing, generators for deriving components of transformation systems from a syntax definition, and glue for composing trasformation tools. [10] Merijn de Jonge, Eelco Visser, and Joost Visser. XT: A bundle of program transformation tools. In M. G. J. van den Brand and D. Perigot, editors, Workshop on Language Descriptions, Tools and Applications (LDTA’01), volume 44 of Electronic Notes in Theoretical Computer Science. Elsevier Science Publishers, April 2001. [ ps.gz, ps.zip ].

Applications Stratego has been applied in many areas. In this section applications are categorized by the type of the source language.

Functional Languages Implemenation of the warm fusion algorithm for deforestation of lazy functional programs [13, 12]. Simplification in the style of the Glasgow Haskell Compiler are illustrated in [14] applied the language Mondrian. A partial evaluator for a subset of Scheme (similix) is described in [11]. [11] Lennart Swart. Partial evaluation using rewrite rules. A specification of a partial evaluator for Similix in Stratego. Master’s thesis, Utrecht University, Utrecht, The Netherlands, August 2002. [pdf]. [12] Patricia Johann and Eelco Visser. Warm fusion in Stratego: A case study in the generation of program transformation systems. Technical Report UU-CS-2000-43, Institute of Information and Computing Sciences, Utrecht University, Utrecht, The Netherlands, 2000. Extended version of article in Annals of Mathematics and Artificial Intelligence, 29(1–4):1–34,2000, [ps.gz, ps.zip] . [13] Patricia Johann and Eelco Visser. Warm fusion in Stratego: A case study in the generation of program transformation systems. Annals of Mathematics and Artificial Intelligence, 29(1–4):1–34, 2000. [ps.gz, ps.zip] . [14] Eelco Dolstra and Hedzer Westra. Transformaties op Mondrian met Stratego. Term paper (in dutch) http://www.cs.uu.nl/~visser/ftp/DW00. pdf Utrecht University, July 2000.

Imperative Languages CodeBoost [23, 22, 17, 16] is a transformation framework for the transformation of C++ programs developed for the optimization of programs written in the Sophus style. 3

Tiger is the example language of Andrew Appel’s text book on compiler construction. It has proven a fruitful basis for experimentation with all kinds of transformations and for use in teaching [15]. Results include techniques for building interpreters [19], implementing instruction selection [20], and specifying optimizations such as function inlining [8] and constant propagation [18]. An extension of Tiger to higher-order functional programming was used to study the specification of inlining strategies and other optimizations such as common subexpression elimination [21]. [15] http://www.stratego-language.org/Tiger. [16] Karl Trygve Kalleberg. User-configurable, high-level transformations with CodeBoost. Master’s thesis, University of Bergen, P.O.Box 7800, N-5020 Bergen, Norway, March 2003. [17] Otto Skrove Bagge. CodeBoost: A framework for transforming C++ programs. Master’s thesis, University of Bergen, P.O.Box 7800, N-5020 Bergen, Norway, March 2003. [18] Karina Olmos and Eelco Visser. Strategies for source-to-source constant propagation. In B. Gramlich and S. Lucas, editors, Workshop on Reduction Strategies (WRS’02), volume 70 of Electronic Notes in Theoretical Computer Science, page 20, Copenhagen, Denmark, July 2002. Elsevier Science Publishers. http://www.elsevier.nl/locate/entcs/volume70. html [pdf]. [19] Eelco Dolstra and Eelco Visser. Building interpreters with rewriting strategies. In Mark van den Brand and Ralf Laemmel, editors, Workshop on Language Descriptions, Tools and Applications (LDTA’02), volume 65/3 of Electronic Notes in Theoretical Computer Science, Grenoble, France, April 2002. Elsevier Science Publishers. [pdf] . [20] Martin Bravenboer and Eelco Visser. Rewriting strategies for instruction selection. In S. Tison, editor, Rewriting Techniques and Applications (RTA’02), volume 2378 of Lecture Notes in Computer Science, pages 237– 251, Copenhagen, Denmark, July 2002. Springer-Verlag. [pdf] . [21] Arne de Bruijn. Implementation of inlining in Stratego. Master’s thesis, Utrecht University, Utrecht, The Netherlands, August 2001. [ps.gz, pdf] . [22] Otto Skrove Bagge, Magne Haveraaen, and Eelco Visser. CodeBoost: A framework for the transformation of C++ programs. Technical Report UU-CS-2001-32, Institute of Information and Computing Sciences, Utrecht University, 2001. [ps.gz, ps.zip] . [23] Otto Skrove Bagge, Magne Haveraaen, and Eelco Visser. A C++ transformation framework (extended abstract). In Proceedings of the Nordic Workshop on Programming Theory (NWPT’00), Bergen, Norway, October 2000.

4

Transformation Tools Stratego is used as the implementation language for numerous meta-tools in the XT bundle of program transformation tools [25, ?]. This includes the implementation of pretty-printing formatters of the generic pretty-printing package GPP [26] and the coupling of Stratego transformation components with SDF parsers [27]. In a documentation generator for SDL [24], Stratego was used to extract transition tables from SDL specifications. [24] Merijn de Jonge and Ramin Monajemi. Cost-effective maintenance tools for proprietary languages. In International Conference on Software Maintenance, ICSM2001. IEEE Computer Society, 2001. (To appear). [25] Merijn de Jonge, Eelco Visser, and Joost Visser. XT: A bundle of program transformation tools. In M. G. J. van den Brand and D. Perigot, editors, Workshop on Language Descriptions, Tools and Applications (LDTA’01), volume 44 of Electronic Notes in Theoretical Computer Science. Elsevier Science Publishers, April 2001. [ ps.gz, ps.zip ]. [26] Merijn de Jonge. A pretty-printer for every occasion. In Ian Ferguson, Jonathan Gray, and Louise Scott, editors, Proceedings of the 2nd International Symposium on Constructing Software Engineering Tools (CoSET2000). University of Wollongong, Australia, 2000. [27] Joost Visser. Stratego + SDF. Stratego Users Day 2000.

Software Deployment The Autobundle software that computes dependencies between packages to create bundles of (XT) packages is implemented in Stratego [28, 29]. [28] Merijn de Jonge. Source tree composition. In Cristina Gacek, editor, Proceedings: Seventh International Conference on Software Reuse, volume 2319 of LNCS, pages 17–32. Springer-Verlag, April 2002. [29] Merijn de Jonge, Eelco Visser, and Joost Visser. Collaborative software development. Technical Report SEN-R0113, CWI, Amsterdam, The Netherlands, 2001. [ ps.gz, ps.zip] .

Documentation Early documentation of Stratego was available in [31, 33, 32]. This documentation is not up to date with the latest version (0.9) of the Stratego distribution. Up-to-date documentation is provided at the documentation page of the Stratego site [30]. This includes a link to the handouts for the Stratego Tutorial at ETAPS 2002. [30] http://www.stratego-language.org/Stratego/ StrategoDocumentation. [31] Eelco Visser. The Stratego Tutorial. Institute of Information and Computing Sciences, Utrecht University, 0.5 edition, 2000. Technical Documentation. [html] . 5

[32] Eelco Visser. The Stratego Reference Manual. Institute of Information and Computing Sciences, Utrecht University, 0.5 edition, 2000. Technical Documentation. [html] . [33] Eelco Visser. The Stratego Library. Institute of Information and Computing Sciences, Utrecht University, 0.5 edition, 2000. Technical Documentation. [html] .

Language Experiments RhoStratego [35, 34] is a language experiment in which some of the features of Stratego are integrated with lazy higher-order functional programming. The traditional case construct is broken down such that case alternatives can be used as first-class program constructs expressing a match and a build. Generic traversal is achieved by allowing variables instead of constructor names in patterns. [34] E. Dolstra and E. Visser. First-class rules and generic traversal. Technical Report UU-CS-2001-38, Institute of Information and Computing Sciences, Utrecht University, Utrecht, The Netherlands, 2001. [pdf] . [35] E. Dolstra. First-class rules and generic traversal for program transformation languages. Master’s thesis, Utrecht University, Utrecht, The Netherlands, August 2001. [ps.gz] .

Types and Proofs for Strategies In [36] a weakest precondition logic is developed to reason about strategies. In [37] a type system for a variant of System S is developed. The problem of typing generic strategies is also addressed in [35, 34, 49, 48]. [36] R. Kieburtz. A logic for rewriting strategies. In Workshop on Strategies in Automated Deduction, Siena, Italy, 2001. [37] R. L¨ ammel. Typed generic traversals in Sγ0 . Technical report, CWI, 2001. Submitted for journal publication.

Implementation The Stratego distribution contains a compiler that translates Stratego specifications to C programs. An early version of the compiler is described in [39]. The complete specification of the compiler is described in [40]. In [25] an optimization for the generic innermost reduction strategy is described and its implementation in Stratego is shown. [38] P. Johann and E. Visser. Fusing logic and control with local transformations: An example optimization. In B. Gramlich and S. Lucas, editors, Workshop on Reduction Strategies in Rewriting and Programming (WRS’01), volume 57 of Electronic Notes in Theoretical Computer Science, Utrecht, The Netherlands, May 2001. Elsevier Science Publishers. [ps.gz, ps.zip,pdf, dvi, bibtex] . 6

[39] E. Visser. A bootstrapped compiler for strategies (extended abstract). In B. Gramlich, H. Kirchner, and F. Pfenning, editors, Strategies in Automated Deduction (STRATEGIES’99), pages 73–83, Trento, Italy, July 5 1999. [40] E. Visser. The Stratego Compiler. Institute of Information and Computing Sciences, Utrecht University, 0.5 edition, 2000. Technical Documentation. Latest version available at www.stratego-language.org [html] .

Surveys Several papers survey aspects of strategies and related mechanisms in programming languages. In [44] a survey of strategies in program transformation systems is presented. The paper introduces the motivation for programmable strategies and discusses a number of systems with (some) support for definition of strategies. In [41] the essential ingredients of strategic programming are determined. In [42] strategic programming is compared to adaptive programming. In [43] the mechanics of program transformation are analyzed. [41] R. Laemmel, E. Visser, and J. Visser. The essence of strategic programming. October 2002. (Draft) [pdf, ps, wiki] . [42] R. L¨ ammel, E. Visser, and J. Visser. Strategic Programming Meets Adaptive Programming. In Proceedings of Aspect-Oriented Software Development (AOSD’03), Boston, USA, March 2003. ACM Press. 10 p.; To appear. [43] J. van Wijngaarden and E. Visser. Transformation mechanics. 2003. (Submitted for publication). [44] E. Visser. A survey of rewriting strategies in program transformation systems. In B. Gramlich and S. Lucas, editors, Workshop on Reduction Strategies in Rewriting and Programming (WRS’01), volume 57 of Electronic Notes in Theoretical Computer Science, Utrecht, The Netherlands, May 2001. Elsevier Science Publishers. [ps.gz, ps.zip, pdf, dvi, bibtex] .

Strategies in Other Languages The ideas of generic traversal underlying Stratego’s strategy operators provides an attractive model of generic operations on data structures and has led to implementations in Java [45, 46, 50], Haskell [49, 48], and Prolog [47]. [45] M. Bravenboer and E. Visser. Guiding visitors: Separating navigation from computation. Technical Report UU-CS-2001-42, Institute of Information and Computing Sciences, Utrecht University, 2001. [pdf] . [46] T. Kuipers and J. Visser. Object-oriented tree traversal with JJForester. In M. van den Brand and D. Parigot, editors, Electronic Notes in Theoretical Computer Science, volume 44. Elsevier Science Publishers, 2001. Proc. of Workshop on Language Descriptions, Tools and Applications (LDTA).

7

[47] R. L¨ ammel and G. Riedewald. Prological language processing. In M. van den Brand and D. Parigot, editors, Electronic Notes in Theoretical Computer Science, volume 44/2. Elsevier Science Publishers, 2001. Proc. of Workshop on Language Descriptions, Tools and Applications (LDTA). [48] R. L¨ ammel and J. Visser. Typed combinators for generic traversal. In Proceedings of Practical Aspects of Declarative Languages (PADL’02), Lecture Notes in Computer Science. Springer-Verlag, 2002. [49] R. L¨ ammel, J. Visser, and J. Kort. Dealing with large bananas. In J. Jeuring, editor, Workshop on Generic Programming, Ponte de Lima, July 2000. Technical Report UU-CS-2000-19, Universiteit Utrecht. [50] J. Visser. Visitor combination and traversal control. In OOPSLA 2001 Conference Proceedings: Object-Oriented Programming Systems, Languages, and Applications. To appear, 2001.

8