The ruby intermediate language

Michael Furr, Jong-hoon (David) An, Jeffrey S. Foster, Michael Hicks
<span title="">2009</span> <i title="ACM Press"> <a target="_blank" rel="noopener" href="https://fatcat.wiki/container/p43mwg6eyzg4jelnsclwsbnuuy" style="color: black;">Proceedings of the 5th symposium on Dynamic languages - DLS &#39;09</a> </i> &nbsp;
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 challenges. Our system includes an
more &raquo; ... nsible GLR parser for Ruby, and an automatic translation into RIL, 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 in its representation. We demonstrate the usefulness of RIL by presenting a simple static analysis and source code transformation to eliminate null pointer errors in Ruby programs. We also describe several additional useful features of RIL, including a pretty printer that outputs RIL as syntactically valid Ruby code, a dataflow analysis engine, and a dynamic instrumentation library for profiling source code. We hope that RIL's features will enable others to more easily build analysis tools for Ruby, and that our design will inspire the creation of similar frameworks for other dynamic languages.
<span class="external-identifiers"> <a target="_blank" rel="external noopener noreferrer" href="https://doi.org/10.1145/1640134.1640148">doi:10.1145/1640134.1640148</a> <a target="_blank" rel="external noopener" href="https://dblp.org/rec/conf/dls/FurrAFH09.html">dblp:conf/dls/FurrAFH09</a> <a target="_blank" rel="external noopener" href="https://fatcat.wiki/release/vtxmv5po7jcdhe6om2d77obk64">fatcat:vtxmv5po7jcdhe6om2d77obk64</a> </span>
<a target="_blank" rel="noopener" href="https://web.archive.org/web/20110813224130/http://www.cs.umd.edu:80/~mwh/papers/ril.pdf" title="fulltext PDF download" data-goatcounter-click="serp-fulltext" data-goatcounter-title="serp-fulltext"> <button class="ui simple right pointing dropdown compact black labeled icon button serp-button"> <i class="icon ia-icon"></i> Web Archive [PDF] <div class="menu fulltext-thumbnail"> <img src="https://blobs.fatcat.wiki/thumbnail/pdf/de/cc/decca92414d53b00ffe9fd282bebab7980585e62.180px.jpg" alt="fulltext thumbnail" loading="lazy"> </div> </button> </a> <a target="_blank" rel="external noopener noreferrer" href="https://doi.org/10.1145/1640134.1640148"> <button class="ui left aligned compact blue labeled icon button serp-button"> <i class="external alternate icon"></i> acm.org </button> </a>