Static Type Inference for Ruby. Michael Furr, Jong hoon (David) An, Jeffrey S. Foster, and Michael Hicks, March 2008.

Many general-purpose, object-oriented scripting languages are dynamically typed, to keep the language flexible and not reject any programs unnecessarily. However, dynamic typing loses many of the benefits of static typing, including early error detection and the useful documentation provided by type annotations. We have been developing Diamondback Ruby (DRuby), a tool that aims to integrate static typing into Ruby, a popular object-oriented scripting language. DRuby makes three main contributions toward this aim. First, we developed a new GLR parser for Ruby that cleanly separates the core Ruby grammar from a set disambiguation rules, making the parser easy to extend. Second, we developed the Ruby Intermediate Language (RIL), a small, simple subset of Ruby to which we can translate the entire source language. RIL makes implementing Ruby analyses much easier than working with the complex surface syntax. Third, DRuby includes a type annotation language and type inference system that has important features that allow it to accurately type Ruby programs. We applied DRuby to a suite of small benchmarks, and found that most of our benchmarks are statically typeable. We believe that DRuby makes a major step forward toward the goal of bringing the benefits of static typing to Ruby and other object-oriented scripting languages.

[ .pdf ]

@MISC{furr08druby,
  AUTHOR = {Michael Furr and Jong-hoon (David) An and Jeffrey S. Foster and Michael Hicks},
  TITLE = {Static Type Inference for Ruby},
  MONTH = MAR,
  YEAR = 2008
}

Back


This file has been generated by bibtex2html 1.69