GGrantIndex
← Search

FMitF: Track II: Transitioning Ruby Types to Practice

$99,998FY2019CSENSF

Tufts University, Medford MA

Investigators

Abstract

Ruby is a popular programming language that is perhaps best known for Ruby on Rails, a framework for developing web sites. However, unlike some other programming languages, Ruby does not have a static type system, which helps detect bugs in programs as they are written. This lack of a static type system can make developing Ruby programs harder, and it also means certain kinds of bugs might remain latent until programs are actually run by users. Over the last ten years, the investigator has been carrying out research on adding static types to Ruby and similar languages. As a result of this work, very recently two key things happened: (1) Stripe, a major payment processing company, decided to develop their own static Ruby type system, and (2) the core Ruby development team decided to add static types to Ruby 3, the next version of the Ruby programming language. The goal of this project is to help bring type checking successfully to Ruby 3 and into practice by transitioning the investigator's research results, knowledge, and experience with Ruby type systems, in collaboration with Stripe and the core Ruby development team. The project's novelties are helping develop a common type annotation language for Ruby, including source-level annotations; integrating those annotations with Ruby document-generation tools; and developing extensive support for type checking Ruby on Rails applications. The project's impacts are that the technology will make it easier and faster to eliminate bugs in Ruby programs earlier in the software development cycle. Since Ruby is widely used, these improvements have the potential to improve the software of many of the websites that millions of people rely on every day. The project builds on RDL, a static type system for Ruby previously developed by the investigator. RDL supports a wide range of type features: nominal types, structural types, high-order method types, intersection and union types, tuple and finite hash types, generics, and a self type, among others. RDL's type language, as well as Stripe's type language, will form the basis of Ruby 3's type language. RDL also has special support for metaprogramming, in which code generates classes and methods as it runs, for use later during execution. Metaprogramming is used extensively in Ruby on Rails. RDL supports meetaprogramming by storing type information at run-time, thereby allowing metaprogramming code to also generate type information for any classes and methods it creates. As part of the project, the PI and his collaborators will use this metaprogramming support to generate type information for Ruby 3's and Stripe's type systems. They will also develop a range of type annotations for popular Ruby libraries and other frameworks. This award reflects NSF's statutory mission and has been deemed worthy of support through evaluation using the Foundation's intellectual merit and broader impacts review criteria.

View original record on NSF Award Search →