Concurrent circular reference attribute grammars

Reference Attribute Grammars (RAGs) is a declarative executable formalism used for constructing compilers and related tools. Existing implementations support concurrent evaluation only with global evaluation locks. This may lead to long latencies in interactive tools, where interactive and background threads query attributes concurrently. We present lock-free algorithms for concurrent attribute evaluation, enabling low latency in interactive tools. Our algorithms support important extensions to RAGs like circular (fixed-point) attributes and higher-order attributes. We have implemented our algorithms in Java, for the JastAdd metacompiler. We evaluate the implementation on a JastAdd-specified compiler for the Java language, demonstrating very low latencies for interactive attribute queries, on the order of milliseconds. Furthermore, initial experiments show a speedup of about a factor 2 when using four parallel compilation threads.

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

[2]  Görel Hedin,et al.  Reference Attributed Grammars , 2000, Informatica.

[3]  Uwe Kastens,et al.  Ordered attributed grammars , 1980, Acta Informatica.

[4]  Maurice Herlihy,et al.  The art of multiprocessor programming , 2020, PODC '06.

[5]  Görel Hedin,et al.  Circular reference attributed grammars - their evaluation and applications , 2007, Sci. Comput. Program..

[6]  Peter J. Stuckey,et al.  Lock-free parallel dynamic programming , 2010, J. Parallel Distributed Comput..

[7]  Martin Jourdan,et al.  A Survey of Parallel Attribute Evaluation Methods , 1991, Attribute Grammars, Applications and Systems.

[8]  Christoff Bürger,et al.  Reference attribute grammar controlled graph rewriting: motivation and overview , 2015, SLE.

[9]  Rodney Farrow Automatic generation of fixed-point-finding evaluators for circular, but well-defined, attribute grammars , 1986, SIGPLAN '86.

[10]  Görel Hedin,et al.  Declarative rewriting through circular nonterminal attributes , 2015, Comput. Lang. Syst. Struct..

[11]  David A. Naumann Observational Purity and Encapsulation , 2005, FASE.

[12]  Larry G. Jones,et al.  Efficient evaluation of circular attribute grammars , 1990, TOPL.

[13]  Görel Hedin,et al.  Concurrent Circular Reference Attribute Grammars (Extended Version) , 2017 .

[14]  John Tang Boyland,et al.  Remote attribute grammars , 2005, JACM.

[15]  Jing Li,et al.  The Qualitas Corpus: A Curated Collection of Java Code for Empirical Studies , 2010, 2010 Asia Pacific Software Engineering Conference.

[16]  Jakob Nielsen,et al.  Chapter 4 – The Usability Engineering Lifecycle , 1993 .

[17]  Torbjörn Ekman,et al.  Rewritable Reference Attributed Grammars , 2004, ECOOP.

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

[19]  Jakob Nielsen,et al.  Usability engineering , 1997, The Computer Science and Engineering Handbook.

[20]  Anthony M. Sloane,et al.  A pure embedding of attribute grammars , 2013, Sci. Comput. Program..

[21]  Jukka Paakki,et al.  Attribute grammar paradigms—a high-level methodology in language implementation , 1995, CSUR.

[22]  Görel Hedin,et al.  JavaRAG: a Java library for reference attribute grammars , 2015, MODULARITY.

[23]  Karl-Erik Årzén,et al.  Modeling and optimization with Optimica and JModelica.org - Languages and tools for solving large-scale dynamic optimization problems , 2010, Comput. Chem. Eng..

[24]  Torbjörn Ekman,et al.  Demand-driven evaluation of collection attributes , 2009, Automated Software Engineering.

[25]  Eric Van Wyk,et al.  Silver: An extensible attribute grammar system , 2008, Sci. Comput. Program..

[26]  Görel Hedin,et al.  DrAST: an inspection tool for attributed syntax trees (tool demo) , 2016, SLE.

[27]  Eric Van Wyk,et al.  Attribute Grammar-Based Language Extensions for Java , 2007, ECOOP.

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

[29]  Milan Ceska,et al.  On Parallel Software Verification Using Boolean Equation Systems , 2012, SPIN.