Title: Checking Interactively-Developed Code
Speaker
Andriy Hnativ
Abstract
The purpose of the Ruby interpreter, irb, is to develop and test code fragments that will eventually form a complete program. Programming with irb is an interactive process, expected to provide immediate feedback from the Ruby interpreter, typically warnings and error messages that show inconsistencies or programming mistakes, when code is executed. However, a program fragment can be executed only when all dependent fragments are also written. This may introduce a potentially substantial delay between programming and validation, filled with distractions from writing the needed dependent code. As a result, error messages are emitted later than necessary, and may appear in other blocks of code than where the error originates. Essentially, irb lacks a type checker:a system to infer types and check their consistency before code is executed. This is not surprising, given the obstacles that irb’s interactive code development raises for type checking. As one develops a program, code fragments are written and re-written; each are difficult to validate in isolation, and complex to merge and re-check collectively. We have implemented a system that reports type errors for incomplete irb programs, by verifying code blocks as they are developed, and checking that they mesh correctly with other code blocks as the developer changes and replaces them. By using principal typings inference, our tool adds lightweight type checking to the Ruby language without changing the syntax. As a result, coders will be able to reduce development time by more precisely locating errors at a better time in the development process.
Date
July 19, 2009
Room
Hitotsubashi Memorial Hall
Speaker Profile
Andriy Hnativ is a M.Sc. student studying programming languages at the University of Saskatchewan under the direction of Prof. Chris Dutchyn. Among other things, he is interested in functional programming languages, open-source development, and dynamic languages, especially Ruby and Python.