Memoized zipper-based attribute grammars and their higher order extension

Abstract Attribute grammars are a powerfull, well-known formalism to implement and reason about programs which, by design, are conveniently modular. In this work we focus on a state of the art zipper-based embedding of classic attribute grammars and higher-order attribute grammars. We improve their execution performance through controlling attribute (re)evaluation by means of memoization techniques. We present the results of our optimizations by comparing their impact in various implementations of different, well-studied, attribute grammars and their Higher-Order extensions.

[1]  Ralf Lämmel,et al.  Strongly typed heterogeneous collections , 2004, Haskell '04.

[2]  João Saraiva,et al.  Functional Incremental Attribute Evaluation , 2000, CC.

[3]  Thomas Johnsson,et al.  Attribute grammars as a functional programming paradigm , 1987, FPCA.

[4]  Martin Jourdan An Optimal-time Recursive Evaluator for Attribute Grammars , 1984, Symposium on Programming.

[5]  S. Doaitse Swierstra,et al.  First-class Attribute Grammars , 2000, Informatica.

[6]  Donald E. Knuth,et al.  Semantics of context-free languages , 1968, Mathematical systems theory.

[7]  Torbjörn Ekman,et al.  The jastadd extensible java compiler , 2007, OOPSLA.

[8]  Thomas W. Reps Optimal-time incremental semantic analysis for syntax-directed editors , 1982, POPL '82.

[9]  João Saraiva,et al.  Data Structure Free Compilation , 1999, CC.

[10]  Atze Dijkstra,et al.  Typing Haskell with an Attribute Grammar (Part I) , 2004 .

[11]  Eric Van Wyk,et al.  Silver: an Extensible Attribute Grammar System , 2008, Electron. Notes Theor. Comput. Sci..

[12]  Bernard Fotsing,et al.  Attribute Grammars as Recursion Schemes over Cyclic Representations of Zippers , 2011, Electron. Notes Theor. Comput. Sci..

[13]  Görel Hedin,et al.  Automated Selective Caching for Reference Attribute Grammars , 2010, SLE.

[14]  João Saraiva,et al.  Lrc - A Generator for Incremental Language-Oriented Tools , 1998, International Conference on Compiler Construction.

[15]  S. Doaitse Swierstra,et al.  Iterative type inference with attribute grammars , 2010, GPCE '10.

[16]  S. Doaitse Swierstra,et al.  Higher order attribute grammars , 1989, PLDI '89.

[17]  S. Doaitse Swierstra,et al.  Incremental evaluation of higher-order attributes , 2017, Sci. Comput. Program..

[18]  S. Doaitse Swierstra,et al.  The architecture of the Utrecht Haskell compiler , 2009, Haskell.

[19]  Bernard Fotsing,et al.  Attribute grammars as tree transducers over cyclic representations of infinite trees and their descriptional composition , 2013, Theor. Comput. Sci..

[20]  S. Doaitse Swierstra,et al.  Using Cached Functions and Constructors for Incremental Attribute Evaluation , 1992, PLILP.

[21]  João Saraiva,et al.  Tools and libraries to model and manipulate circular programs , 2007, PEPM '07.

[22]  Gérard P. Huet,et al.  The Zipper , 1997, Journal of Functional Programming.

[23]  Uwe Kastens,et al.  The Eli System , 1998, CC.

[24]  Tarmo Uustalu,et al.  Comonadic functional attribute evaluation , 2005, Trends in Functional Programming.

[25]  Henk Alblas,et al.  Attribute Evaluation Methods , 1991, Attribute Grammars, Applications and Systems.

[26]  Thomas N. Turba An exception-based mechanism for syntactic error recovery , 1984, SIGP.

[27]  Ulf Norell,et al.  Attribute grammars in Erlang , 2015, Erlang Workshop.

[28]  John Hughes,et al.  Lazy Memo-functions , 1985, FPCA.

[29]  João Saraiva,et al.  Embedding attribute grammars and their extensions using functional zippers , 2016, Sci. Comput. Program..

[30]  João Saraiva Component-Based Programming for Higher-Order Attribute Grammars , 2002, GPCE.

[31]  S. D. Swierstra,et al.  Using attribute grammars to derive efficient functional programs , 1986 .

[32]  Richard S. Bird Using circular programs to eliminate multiple traversals of data , 2004, Acta Informatica.

[33]  Martin Jourdan Strongly non-circular attribute grammars and their recursive evaluation , 1984, SIGPLAN '84.

[34]  S. Doaitse Swierstra,et al.  Attribute grammars fly first-class: how to do aspect oriented programming in Haskell , 2009, ICFP.

[35]  João Saraiva,et al.  Zipper-Based Attribute Grammars and Their Extensions , 2013, SBLP.

[36]  Bernard Fotsing,et al.  Yet Another Implementation of Attribute Evaluation , 2007 .

[37]  Uwe Kastens Implementation of Visit-Oriented Attribute Evaluators , 1991, Attribute Grammars, Applications and Systems.

[38]  Florent Balestrieri The productivity of polymorphic stream equations and the composition of circular traversals , 2015 .

[39]  João Saraiva,et al.  Generating Spreadsheet-Like Tools from Strong Attribute Grammars , 2003, GPCE.

[40]  Johan Jeuring,et al.  Generic programming with fixed points for mutually recursive datatypes , 2009, ICFP.

[41]  João Saraiva,et al.  Memoized Zipper-Based Attribute Grammars , 2016, SBLP.

[42]  João Saraiva,et al.  Designing and Implementing Combinator Languages , 1998, Advanced Functional Programming.

[43]  S. Doaitse Swierstra,et al.  Higher Order Attribute Grammars , 1991, Attribute Grammars, Applications and Systems.

[44]  Thomas Reps,et al.  The synthesizer generator , 1984 .

[45]  Anthony M. Sloane,et al.  A Pure Object-Oriented Embedding of Attribute Grammars , 2010, LDTA.