skip to main content
10.1145/2480362.2480655acmconferencesArticle/Chapter ViewAbstractPublication PagessacConference Proceedingsconference-collections
research-article

The ruby type checker

Published:18 March 2013Publication History

ABSTRACT

We present the Ruby Type Checker (rtc), a tool that adds type checking to Ruby, an object-oriented, dynamic scripting language. Rtc is implemented as a Ruby library in which all type checking occurs at run time; thus it checks types later than a purely static system, but earlier than a traditional dynamic type system. Rtc supports type annotations on classes, methods, and objects and rtc provides a rich type language that includes union and intersection types, higherorder (block) types, and parametric polymorphism among other features. Rtc is designed so programmers can control exactly where type checking occurs: type-annotated objects serve as the "roots" of the type checking process, and unannotated objects are not type checked. We have applied rtc to several programs and found it to be easy to use and effective at checking types.

References

  1. Jong-hoon (David) An, Avik Chaudhuri, Jeffrey S. Foster, and Michael Hicks. Dynamic Inference of Static Types for Ruby. In POPL, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Jong-hoon (David) An, Avik Chaudhuri, Jefrey S. Foster, and Michael Hicks. Position Paper: Dynamically Inferred Types for Dynamic Languages. In STOP, 2011.Google ScholarGoogle Scholar
  3. Davide Ancona, Massimo Ancona, Antonio Cuni, and Nicholas Matsakis. RPython: Reconciling Dynamically and Statically Typed OO Languages. In DLS, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Christopher Anderson, Paola Giannini, and Sophia Drossopoulou. Towards Type Inference for JavaScript. In ECOOP, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. John Aycock. Aggressive Type Inference. In International Python Conference, 2000.Google ScholarGoogle Scholar
  6. Bard Bloom, John Field, Nathaniel Nystrom, Johan Östlund, Gregor Richards, Rok Strniša, Jan Vitek, and Tobias Wrigstad. Thorn: Robust, Concurrent, Extensible Scripting on the JVM. In OOPSLA, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Robert Bruce Findler and Matthias Felleisen. Contracts for Higher-Order Functions. In ICFP, 2002.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Michael Furr, Jong-hoon (David) An, and Jeffrey S. Foster. Profile-Guided Static Typing for Dynamic Scripting Languages. In OOPSLA, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Michael Furr, Jong-hoon (David) An, Jeffrey S. Foster, and Michael Hicks. Static Type Inference for Ruby. In OOPS Track at SAC, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Bertrand Meyer. Applying Design by Contract. IEEE Computer, 25(10):40--51, October 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Michael Salib. Starkiller: A Static Type Inferencer and Compiler for Python. Master's thesis, MIT, 2004.Google ScholarGoogle Scholar
  12. Jeremy G. Siek and Walid Taha. Gradual Typing for Functional Languages. In Scheme and Functional Programming Workshop, 2006.Google ScholarGoogle Scholar
  13. T. Stephen Strickland and Matthias Felleisen. Contracts for First-Class Classes. In DLS, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Peter Thiemann. Towards a Type System for Analyzing JavaScript Programs. In ESOP, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Sam Tobin-Hochstadt and Matthias Felleisen. The Design and Implementation of Typed Scheme. In POPL, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. The ruby type checker

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in
              • Published in

                cover image ACM Conferences
                SAC '13: Proceedings of the 28th Annual ACM Symposium on Applied Computing
                March 2013
                2124 pages
                ISBN:9781450316569
                DOI:10.1145/2480362

                Copyright © 2013 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 18 March 2013

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • research-article

                Acceptance Rates

                SAC '13 Paper Acceptance Rate255of1,063submissions,24%Overall Acceptance Rate1,650of6,669submissions,25%

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader