The ruby intermediate language
Title | The ruby intermediate language |
Publication Type | Journal Articles |
Year of Publication | 2009 |
Authors | Furr M, An J-hoon(D), Foster JS, Hicks MW |
Journal | SIGPLAN Not. |
Volume | 44 |
Issue | 12 |
Pagination | 89 - 98 |
Date Published | 2009/10// |
ISBN Number | 0362-1340 |
Keywords | intermediate language, profile guided anlaysis, ril, ruby |
Abstract | Ruby is a popular, dynamic scripting language that aims to "feel natural to programmers" and give users the "freedom to choose" among many different ways of doing the same thing. While this arguably makes programming in Ruby easier, it makes it hard to build analysis and transformation tools that operate on Ruby source code. In this paper, we present the Ruby Intermediate Language (RIL), a Ruby front-end and intermediate representation that addresses these. RIL includes an extensible GLR parser for Ruby, and an automatic translation into an easy-to-analyze intermediate form. This translation eliminates redundant language constructs, unravels the often subtle ordering among side effecting operations, and makes implicit interpreter operations explicit. We also describe several additional useful features of RIL, such as a dynamic instrumentation library for profiling source code and a dataflow analysis engine. We demonstrate the usefulness of RIL by presenting a static and dynamic analysis to eliminate null pointer errors in Ruby programs. We hope that RIL's features will enable others to more easily build analysis tools for Ruby, and that our design will inspire the of similar frameworks for other dynamic languages. |
URL | http://doi.acm.org/10.1145/1837513.1640148 |
DOI | 10.1145/1837513.1640148 |