Overview

Diamondback Ruby (DRuby) is an extension to Ruby that aims to bring the benefits of static typing to Ruby without compromising the expressiveness of the language. The main features of DRuby are:

Type inference: DRuby uses inference to model most of Ruby’s idioms as precisely as possible without any need for programmer intervention.

Type annotations: Methods may be given explicit type annotations with an easy to use syntax inspired by RDoc.

Dynamic checking: When necessary, methods can be type checked at runtime, using contracts to isolate and properly blame any errant code, similar to gradual typing.

Metaprogramming support: DRuby includes a combined static and dynamic analysis to precisely model dynamic meta-programming constructs, such as eval and method_missing.

News

11/19/2009 – Added two new papers. “Static Typing for Ruby on Rails” (ASE’09) and “Work In Progress: an Empirical Study of Static Typing in Ruby” (PLATEAU’09)

09/03/2009 – Added two new conference papers. “The Ruby Intermediate Language” (DLS’09) and “Profile-Guided Static Typing for Dynamic Scripting Languages” (OOPSLA’09)

07/26/2009 – New release with many bug fixes and a few new features. See the download page for details

04/21/2009 – This source tarball now includes the files necessary to build new rubygem packages. Also fixed a couple of minor bugs since 20090415.

Current Status

While DRuby is an ongoing research project, it already works quite well for small, self-contained Ruby scripts. Currently, it is unable to analyze much of the Ruby standard library “out-of-the-box”. Analyzing such library code is something we’re working toward and have already had some initial success, finding several real programming errors with its analysis.

The DRuby type analysis is built on top of a more general framework for analyzing Ruby programs (which we call RIL — the Ruby Intermediate Language). In future releases, we plan to distribute this framework separately in the hope that other researchers can use RIL to explore their own ideas for Ruby. Until then, a motivated OCaml hacker should already be able to get started with the current tarball, but feel free to email our mailing list if you need help.

People

Michael Furr

Jong-hoon (David) An

Mark Daly

Benjamin Kirzhner

Avik Chaudhuri

Jeffrey Foster

Michael Hicks



Contact

Got a question? Send us an email on our mailing list