Thu 16 Jun 2016 15:30 - 16:00 at Grand Ballroom San Rafael - Types II Chair(s): Jean Yang

Dynamic languages have many compelling benefits, but the lack of static types means subtle errors can remain latent in code for a long time. While many researchers have developed various systems to bring some of the benefits of static types to dynamic languages, prior approaches have trouble dealing with metaprogramming, which generates code as the program executes. For example, Ruby on Rails is a powerful framework that relies heavily on metaprogramming.

In this paper, we propose Hummingbird, a new system that can type check Ruby code even in the presence of metaprogramming. In Hummingbird, method type signatures are gathered dynamically at run-time, as those methods are created. When a method is called, Hummingbird statically type checks the method body against current type signatures. Thus, Hummingbird provides thorough static checks on a per-method basis, while also allowing arbitrarily complex metaprogramming. For performance, Hummingbird memoizes the static type checking pass, invalidating cached checks only if necessary. We formalize Hummingbird using a core, Ruby-like language and prove it sound. We also implemented Hummingbird and applied it to six apps, including three that use Rails. We found that all apps typecheck successfully using Hummingbird. By applying Hummingbird to earlier versions of one app, we also found several type errors that were introduced and then fixed. Finally, we found that Hummingbird’s performance overhead is reasonable.

Thu 16 Jun
Times are displayed in time zone: (GMT-07:00) Tijuana, Baja California change

15:30 - 17:00: Research Papers - Types II at Grand Ballroom San Rafael
Chair(s): Jean YangCarnegie Mellon University
pldi-2016-papers15:30 - 16:00
Brianna M. RenUniversity of Maryland, College Park, Jeffrey S. FosterUniversity of Maryland, College Park
Media Attached
pldi-2016-papers16:00 - 16:30
Tomas PetricekUniversity of Cambridge, UK, Don SymeMicrosoft, Gustavo GuerraMicrosoft Corporation, London
Pre-print Media Attached
pldi-2016-papers16:30 - 17:00
He ZhuPurdue University, Gustavo PetriLIAFA, Université Paris Diderot, Suresh JagannathanPurdue University
Media Attached