RubyWrite: A Ruby-embedded Domain-specic Language for High-level Transformations

RubyWrite is a Domain Specific Language (DSL), embedded within Ruby, with the goal of providing an extensible, effective, portable, and easy to use framework for encoding sourcelevel transformations. Embedding within Ruby provides access to the powerful features of Ruby, including its meta-programming capabilities. Ruby’s multi-paradigm programming model and flexible syntax drove our decision to use it as a host language. Easy integration with C interfaces lets us move performance critical operations to C, or link with external libraries. RubyWrite consists of three components, a tree builder, an unparser, and a tree rewriter. It has been used in multiple compiler research projects and as a teaching aid in a graduate-level compilers course. We expect RubyWrite to be widely applicable and a proof of concept in leveraging a modern language to write a portable compiler infrastructure core. This page intentionally left blank.

[1]  Eelco Visser,et al.  Program Transformation with Scoped Dynamic Rewrite Rules , 2006, Fundam. Informaticae.

[2]  Jules J. Berman,et al.  Ruby: The Programming Language , 2008 .

[3]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[4]  Monica S. Lam,et al.  The SUIF Compiler System: a Parallelizing and Optimizing Research Compiler , 1994 .

[5]  Sorin Lerner,et al.  Automated soundness proofs for dataflow analyses and transformations via local rules , 2005, POPL '05.

[6]  Andrew Lumsdaine,et al.  A language for specifying compiler optimizations for generic software , 2007 .

[7]  Bronis R. de Supinski,et al.  Semantic-Driven Parallelization of Loops Operating on User-Defined Containers , 2003, LCPC.

[8]  R. Kent Dybvig,et al.  A nanopass infrastructure for compiler education , 2004, ICFP '04.

[9]  C. van Reeukwijk Tm: a Code Generator for Recursive Data Structures , 1992, Softw. Pract. Exp..

[10]  John W. Eaton,et al.  Gnu Octave Manual , 2002 .

[11]  Magne Haveraaen,et al.  Design of the CodeBoost transformation system for domain-specific optimisation of C++ programs , 2003, Proceedings Third IEEE International Workshop on Source Code Analysis and Manipulation.

[12]  Eelco Visser,et al.  Stratego/XT 0.17. A language and toolset for program transformation , 2008, Sci. Comput. Program..

[13]  M. Jonge,et al.  A pretty-printer for every occasion , 2001 .

[14]  Richard W. Vuduc,et al.  POET: Parameterized Optimizations for Empirical Tuning , 2007, 2007 IEEE International Parallel and Distributed Processing Symposium.

[15]  Parasuram Anantharam Programming ruby , 2001, SOEN.

[16]  Elizabeth Charnock On the web. , 2012, Nursing children and young people.

[17]  Torbjörn Ekman,et al.  The JastAdd system - modular extensible compiler construction , 2007, Sci. Comput. Program..