Static Type Inference for Ruby. Michael Furr, Jong hoon (David) An, Jeffrey S. Foster, and Michael Hicks. In Proceedings of the ACM Symposium on Applied Computing, Object-oriented Programming Languages and Systems Track (OOPS), pages 1859-1866, March 2009.

Many general-purpose, object-oriented scripting languages are dynamically typed, which provides flexibility but leaves the programmer without the benefits of static typing, including early error detection and the documentation provided by type annotations. This paper describes Diamondback Ruby (DRuby), a tool that blends Ruby's dynamic type system with a static typing discipline. DRuby provides a type language that is rich enough to precisely type Ruby code we have encountered, without unneeded complexity. When possible, DRuby infers static types to discover type errors in Ruby programs. When necessary, the programmer can provide DRuby with annotations that assign static types to dynamic code. These annotations are checked at run time, isolating type errors to unverified code. We applied DRuby to a suite of benchmarks and found several bugs that would cause run-time type errors. DRuby also reported a number of warnings that reveal questionable programming practices in the benchmarks. We believe that DRuby takes a major step toward bringing the benefits of combined static and dynamic typing to Ruby and other object-oriented languages.

[ .pdf ]

@INPROCEEDINGS{furr08druby,
  AUTHOR = {Michael Furr and Jong-hoon (David) An and Jeffrey S. Foster and Michael Hicks},
  TITLE = {Static Type Inference for {Ruby}},
  BOOKTITLE = {Proceedings of the {ACM} Symposium on Applied Computing, Object-oriented Programming Languages and Systems Track (OOPS)},
  MONTH = MAR,
  YEAR = 2009,
  PAGES = {1859--1866}
}

This file has been generated by bibtex2html 1.69