## Building Interpreters with Rewriting Strategies (2002)

### Cached

### Download Links

- [www.cwi.nl]
- [archive.cs.uu.nl]
- [www.cs.uu.nl]
- [ftp.cwi.nl]
- [www.cwi.nl]
- [www.cs.uu.nl]
- DBLP

### Other Repositories/Bibliography

Venue: | Workshop on Language Descriptions, Tools and Applications (LDTA’02), volume 65/3 of Electronic Notes in Theoretical Computer Science |

Citations: | 10 - 6 self |

### BibTeX

@INPROCEEDINGS{Dolstra02buildinginterpreters,

author = {Eelco Dolstra and Eelco Visser},

title = {Building Interpreters with Rewriting Strategies},

booktitle = {Workshop on Language Descriptions, Tools and Applications (LDTA’02), volume 65/3 of Electronic Notes in Theoretical Computer Science},

year = {2002},

pages = {57--76},

publisher = {Elsevier Science Publishers}

}

### Years of Citing Articles

### OpenURL

### Abstract

Programming language semantics based on pure rewrite rules suers from the gap between the rewriting strategy implemented in rewriting engines and the intended evaluation strategy. This paper shows how programmable rewriting strategies can be used to implement interpreters for programming languages based on rewrite rules. The advantage of this approach is that reduction rules are rst class entities that can be reused in dierent strategies, even in other kinds of program transformations such as optimizers. The approach is illustrated with several interpreters for the lambda calculus based on implicit and explicit (parallel) substitution, dierent strategies including normalization, eager evaluation, lazy evaluation, and lazy evaluation with updates. An extension with pattern matching and choice shows that such interpreters can easily be extended.

### Citations

302 | Natural semantics
- Kahn
- 1987
(Show Context)
Citation Context ... basis for implementing other program transformations, such as optimizers, refactoring engines, and software renovation tools. There are dierent styles of operational semantics. In natural semantics [=-=9]-=- supported by the CENTAUR system [3] an expression is directly related to its value, possibly through the use of recursive invocations of the evaluation relation. In rewriting semantics, supported by ... |

257 | R.: The revised report on the syntactic theories of sequential control and - Felleisen, Hieb - 1992 |

136 | CENTAUR: The System
- Borras, Clement, et al.
- 1988
(Show Context)
Citation Context ...m transformations, such as optimizers, refactoring engines, and software renovation tools. There are dierent styles of operational semantics. In natural semantics [9] supported by the CENTAUR system [=-=3]-=- an expression is directly related to its value, possibly through the use of recursive invocations of the evaluation relation. In rewriting semantics, supported by many systems including ASF+SDF [4] a... |

133 | Stratego: A language for program transformation based on rewriting strategies. System description of Stratego 0.5
- Visser
- 2001
(Show Context)
Citation Context ...RhoStratego language [6]. Section 7 discusses applications of this approach. All examples are specied in Stratego, a language for program transformation based on the paradigm of rewriting strategies [=-=14-=-]. We explain the Stratego constructs used, but not in depth. For a full account see [14,13,16]. 2 Lambda Reduction with Explicit Substitution In this section we explore various ways of dening interpr... |

131 |
Modern Compiler Implementation in ML
- Appel
- 1998
(Show Context)
Citation Context ...n several realistic interpreters, including interpreters for Tiger, RhoStratego, and StrategoScript, an interpreter for Stratego specications. A specication of an interpreter for the Tiger language [1=-=]-=- is part of the Tiger-in-Stratego project 1 , which explores the application of program transformation techniques in compilation. The language includes imperative features such as loops, assignments, ... |

109 | A Tolmach. Building program optimizers with rewriting strategies
- Visser, Benaissa
- 1998
(Show Context)
Citation Context ...e used for other program transformations than complete evaluation of a program by using a dierent strategy. Indeed, the approach stems from the implementation of optimizers with rewriting strategies [=-=16-=-]. We illustrate the approach by dening a number of interpreters for lambda expressions. Although the lambda calculus is not a fullsedged programming language, it is useful to illustrate various solut... |

85 | Elan: A logical framework based on computational systems
- Borovansky, Kirchner, et al.
(Show Context)
Citation Context ...ession is directly related to its value, possibly through the use of recursive invocations of the evaluation relation. In rewriting semantics, supported by many systems including ASF+SDF [4] and ELAN =-=[-=-2], an expression is normalized by successive applications of reduction rules, which dene a, generally small, modication of an expression. In the approach of syntactic theories [7], supported for exam... |

74 |
Language Prototyping: An Algebraic Specification Approach, volume V. World Scientific
- Deursen, Heering, et al.
- 1996
(Show Context)
Citation Context ...m [3] an expression is directly related to its value, possibly through the use of recursive invocations of the evaluation relation. In rewriting semantics, supported by many systems including ASF+SDF =-=[-=-4] and ELAN [2], an expression is normalized by successive applications of reduction rules, which dene a, generally small, modication of an expression. In the approach of syntactic theories [7], suppo... |

54 | Meta-programming with concrete object syntax
- Visser
- 2002
(Show Context)
Citation Context ...xp -> Exp // "\\" Id "->" Exp -> Exp Stratego specications dene transformations on abstract syntax terms. However, concrete syntax can be regarded as syntactic sugar for abstract s=-=yntax expressions [15]. Concrete syntax terms will b-=-e written between [[ and ]]. Thus, [[ (\x -> x) y ]] denotes the term App(Abs("x", Var("x")), Var("y")). We will use concrete syntax in rules, but abstract syntax in the ... |

31 | Montages Specifications of Realistic Programming Languages
- Kutter, Pierantonio
- 1997
(Show Context)
Citation Context ...anslated to an action, which represents its computation. In the LPS system [11] an expression is mapped onto a monadic computation [12]. In Montages programs are translated to abstract state machines =-=[10]-=-. While denotational c○2002 Published by Elsevier Science B. V.Dolstra and Visser semantics is very useful for building compilers, it does not provide a theory of syntactic manipulation of programs a... |

25 |
Composing programming languages by combining action-semantics modules
- Doh, Mosses
(Show Context)
Citation Context ...oach. In the denotational approach a program expression is translated to its computational value. Typical systems supporting this approach are action semantics, LPS, and Montages. In action semantics =-=[5]-=- an expression is translated to an action, which represents its computation. In the LPS system [11] an expression is mapped onto a monadic computation [12]. In Montages programs are translated to abst... |

20 |
Building interpreters by composing monads
- Jr
- 1994
(Show Context)
Citation Context ...ntics, LPS, and Montages. In action semantics [5] an expression is translated to an action, which represents its computation. In the LPS system [11] an expression is mapped onto a monadic computation =-=[12]-=-. In Montages programs are translated to abstract state machines [10]. While denotational cs2002 Published by Elsevier Science B. V. Dolstra and Visser semantics is very useful for building compilers,... |

17 | Scoped dynamic rewrite rules
- Visser
- 2001
(Show Context)
Citation Context ...s are specied in Stratego, a language for program transformation based on the paradigm of rewriting strategies [14]. We explain the Stratego constructs used, but not in depth. For a full account see [=-=14,13,16-=-]. 2 Lambda Reduction with Explicit Substitution In this section we explore various ways of dening interpreters for lambda expressions using explicit substitution. Lambda expressions are composed of v... |

11 | Fusing Logic and Control with Local Transformations: An Example Optimization
- Johann, Visser
- 2001
(Show Context)
Citation Context ...). If that succeeds, it recursively reduces the result of applying the rule. Otherwise the term is in normal form. To avoid renormalizing terms, the memo operator memorizes normalization results. See =-=[8-=-] for an optimization of the innermost strategy that does not depend on memorization. Reusing the same set of rules we can now dene a more ecient evaluation strategy based on innermost: eval3 = innerm... |

11 | From syntactic theories to interpreters: Automating the proof of unique decomposition
- Xiao, Sabry, et al.
(Show Context)
Citation Context ...alized by successive applications of reduction rules, which dene a, generally small, modication of an expression. In the approach of syntactic theories [7], supported for example by the SL language [1=-=7,18]-=-, a set of reduction rules is extended with evaluation contexts that limit the positions in which reduction rules can be applied. Thus, evaluation contexts overcome a limitation of pure rewriting base... |

5 |
Montages: Speci of realistic programming languages
- Kutter, Pierantonio
- 1997
(Show Context)
Citation Context ...anslated to an action, which represents its computation. In the LPS system [11] an expression is mapped onto a monadic computation [12]. In Montages programs are translated to abstract state machines =-=[10]-=-. While denotational cs2002 Published by Elsevier Science B. V. Dolstra and Visser semantics is very useful for building compilers, it does not provide a theory of syntactic manipulation of programs a... |

4 | From syntactic theories to interpreters: A specification language and its compilation
- Xiao, Ariola, et al.
- 2000
(Show Context)
Citation Context ...alized by successive applications of reduction rules, which dene a, generally small, modication of an expression. In the approach of syntactic theories [7], supported for example by the SL language [1=-=7,18]-=-, a set of reduction rules is extended with evaluation contexts that limit the positions in which reduction rules can be applied. Thus, evaluation contexts overcome a limitation of pure rewriting base... |

3 | First-class rules and generic traversal for program transformation languages
- Dolstra
- 2001
(Show Context)
Citation Context ...s the case, for example, in the approach to modular action semantics [5]; it is possible to dene dierent interpreters in the same specication module based on the same set of rules. For example, in [6] interpreters based on lazy and strict evaluation for RhoStratego are dened using the same set of rules. Furthermore, the set of rules can be used for other program transformations than complete eval... |

2 |
Cernuda del Río. Lps: A language prototyping system using modular monadic semantics
- Gayo, Díez, et al.
- 2001
(Show Context)
Citation Context ...Typical systems supporting this approach are action semantics, LPS, and Montages. In action semantics [5] an expression is translated to an action, which represents its computation. In the LPS system =-=[11]-=- an expression is mapped onto a monadic computation [12]. In Montages programs are translated to abstract state machines [10]. While denotational c○2002 Published by Elsevier Science B. V.Dolstra and... |

1 |
Cernuda del R io. Lps: A language prototyping system using modular monadic semantics
- Gayo, D
(Show Context)
Citation Context ...Typical systems supporting this approach are action semantics, LPS, and Montages. In action semantics [5] an expression is translated to an action, which represents its computation. In the LPS system =-=[11]-=- an expression is mapped onto a monadic computation [12]. In Montages programs are translated to abstract state machines [10]. While denotational cs2002 Published by Elsevier Science B. V. Dolstra and... |