ABSTRACT
When scripts in untyped languages grow into large programs, maintaining them becomes difficult. A lack of types in typical scripting languages means that programmers must (re)discover critical pieces of design information every time they wish to change a program. This analysis step both slows down the maintenance process and may even introduce mistakes due to the violation of undiscovered invariants.
This paper presents Typed Scheme, an explicitly typed extension of an untyped scripting language. Its type system is based on the novel notion of occurrence typing, which we formalize and mechanically prove sound. The implementation of Typed Scheme additionally borrows elements from a range of approaches, including recursive types, true unions and subtyping, plus polymorphism combined with a modicum of local inference. Initial experiments with the implementation suggest that Typed Scheme naturally accommodates the programming style of the underlying scripting language, at least for the first few thousand lines of ported code.
- Alexander Aiken, Edward L. Wimmers, and T. K. Lakshman. Soft typing with conditional types. In POPL '94: Proceedings of the 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 163--173, New York, NY, USA, 1994. ACM Press. Google Scholar
Digital Library
- Roberto Amadio and Luca Cardelli. Subtyping recursive types. In ACM Transactions on Programming Languages and Systems, volume 15, pages 575--631, 1993. Google Scholar
Digital Library
- Gilad Bracha. Pluggable type systems. In Revival of Dynamic Languages Workshop at OOPSLA 2004, October 2004.Google Scholar
- Gilad Bracha and David Griswold. Strongtalk: typechecking Smalltalk in a production environment. In OOPSLA '93: Proceedings of the Eighth Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 215--230, New York, NY, USA, 1993. ACM Press. Google Scholar
Digital Library
- R. Cartwright. User-defined data types as an aid to verifying lisp programs. In Third International Colloquium on Automata, Languages and Programming, pages 228--256, 1976.Google Scholar
- Robert Cartwright and Mike Fagan. Soft typing. In PLDI '91: Proceedings of the ACM SIGPLAN 1991 Conference on Programming Language Design and Implementation, pages 278--292, New York, NY, USA, 1991. ACM Press. Google Scholar
Digital Library
- Karl Crary, Stephanie Weirich, and Greg Morrisett. Intensional polymorphism in type-erasure semantics. In ICFP '98: Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming, pages 301--312, New York, NY, USA, 1998. ACM Press. ISBN 1--58113--024--4. doihttp://doi.acm.org/10.1145/289423.289459. Google Scholar
Digital Library
- Ryan Culpepper, Sam Tobin-Hochstadt, and Matthew Flatt. Advanced Macrology and the Implementation of Typed Scheme. In Proceedings of the Eighth Workshop on Scheme and Functional Programming, 2007.Google Scholar
- R. Kent Dybvig and Robert Hieb. A new approach to procedures with variable arity. Lisp and Symbolic Computation: An International Journal, 3 (3), 1990. Google Scholar
Digital Library
- Hsianlin Dzeng and Christopher T. Haynes. Type reconstruction for variable-arity procedures. In LFP '94: Proceedings of the 1994 ACM conference on LISP and Functional Programming, pages 239--249, New York, NY, USA, 1994. ACM Press. Google Scholar
Digital Library
- ECMA International. ECMAScript Edition 4 group wiki, 2007.Google Scholar
- Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi. How to Design Programs. MIT Press, 2001. URL http://www.htdp.org/.Google Scholar
- Robert Bruce Findler and Matthias Felleisen. Contracts for higher-order functions. In ICFP '02: ACM SIGPLAN International Conference on Functional Programming, pages 48--59, 2002. Google Scholar
Digital Library
- Robert Bruce Findler, John Clements, Cormac Flanagan, Matthew Flatt, Shriram Krishnamurthi, Paul Steckler, and Matthias Felleisen. DrScheme: A programming environment for Scheme. Journal of Functional Programming, 12(2): 159--182, 2002. Google Scholar
Digital Library
- Cormac Flanagan and Matthias Felleisen. Componential set-based analysis. ACM Trans. Program. Lang. Syst., 21(2):370--416, 1999. Google Scholar
Digital Library
- Cormac Flanagan, Matthew Flatt, Shriram Krishnamurthi, Stephanie Weirich, and Matthias Felleisen. Catching bugs in the web of program invariants. In PLDI '96: ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 23--32, May 1996. Google Scholar
Digital Library
- Matthew Flatt. Composable and compilable macros: You want it when? In ICFP '02: ACM SIGPLAN International Conference on Functional Programming, pages 72--83, 2002. Google Scholar
Digital Library
- Matthew Flatt and Matthias Felleisen. Units: Cool modules for HOT languages. In PLDI '98: ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 236--248, June 1998. Google Scholar
Digital Library
- Matthew Flatt, Robert Bruce Findler, and Matthias Felleisen. Scheme with classes, mixins, and traits. In Asian Symposium on Programming Languages and Systems (APLAS) 2006, pages 270--289, November 2006. Google Scholar
Digital Library
- Daniel P. Friedman and Matthias Felleisen. The Little Schemer, Fourth Edition. MIT Press, Cambridge, 1997.Google Scholar
- Daniel P. Friedman and Matthias Felleisen. The Seasoned Schemer. MIT Press, Cambridge, 1996. Google Scholar
Digital Library
- David Gifford, Pierre Jouvelot, John Lucassen, and Mark Sheldon. FX-87 Reference Manual. Technical Report MIT/LCS/TR-407, Massachusetts Institute of Technology, Laboratory for Computer Science, September 1987.Google Scholar
- J. Gosling, B. Joy, G. L.Steele, and G. Bracha. The Java Language Specification, Third Edition. Addison-Welsley, 2005. Google Scholar
Digital Library
- Timothy G. Griffin. The formulae-as-types notion of control. In POPL '90: Conf. Record 17th Annual ACM Symp. on Principles of Programming Languages, Jan 1990. Google Scholar
Digital Library
- Robert Harper and Greg Morrisett. Compiling polymorphism using intensional type analysis. In POPL '95: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 130--141, 1995. Google Scholar
Digital Library
- Christopher T. Haynes. Infer: A statically-typed dialect of scheme. Technical Report 367, Indiana University, 1995.Google Scholar
- Nevin Heintze. Set based analysis of ML programs. In LFP '94: ACM Symposium on Lisp and Functional Programming, pages 306--317, 1994. Google Scholar
Digital Library
- Fritz Henglein and Jakob Rehof. Safe polymorphic type inference for a dynamically typed language: translating Scheme to ML. In FPCA '95: Proceedings of the Seventh International Conference on Functional Programming Languages and Computer Architecture, pages 192--203, 1995. Google Scholar
Digital Library
- David Herman, Aaron Tomb, and Cormac Flanagan. Space-efficient gradual typing. In 8th Symposium on Trends in Functional Programming, April 2007.Google Scholar
- Gary T. Leavens, Curtis Clifton, and Brian Dorn. A Type Notation for Scheme. Technical Report 05--18a, Iowa State University, August 2005.Google Scholar
- Jacob Matthews. Component deployment with PLaneT: You want it where? In Proceedings of the Seventh Workshop on Scheme and Functional Programming, University of Chicago, Technical Report TR-2006-06, 2006.Google Scholar
- Jacob Matthews, Robert Findler, Matthew Flatt, and Matthias Felleisen. A visual environment for developing context-sensitive term rewriting systems. In RTA 2004: Rewriting Techniques and Applications, 15th International Conference, Aachen, Germany, June 3-5, 2004, Proceedings, volume 3091 of Lecture Notes in Computer Science, pages 2--16. Springer-Verlag, 2004.Google Scholar
Cross Ref
- Philippe Meunier, Robert Bruce Findler, and Matthias Felleisen. Modular set-based analysis from contracts. In POPL '06: Conference Record of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 218--231, New York, NY, USA, 2006. ACM Press. Google Scholar
Digital Library
- Tobias Nipkow, Lawrence C. Paulson, and Markus Wenzel. Isabelle/HOL - A Proof Assistant for Higher-Order Logic, volume 2283 of LNCS. Springer, 2002. Google Scholar
Digital Library
- Benjamin C. Pierce. Programming with intersection types, union types, and polymorphism. Technical Report CMU-CS-91-106, Carnegie Mellon University, February 1991.Google Scholar
- Benjamin C. Pierce and David N. Turner. Local type inference. volume 22, pages 1--44, New York, NY, USA, 2000. ACM. Google Scholar
Digital Library
- John C. Reynolds. Types, abstraction, and parametric polymorphism. In REA. Mason, editor, Information Processing 83, Paris, France, pages 513--523. Elsevier, 1983.Google Scholar
- Michael Salib. Starkiller: A static type inferencer and compiler for Python. Master's thesis, Massachusetts Institute of Technology, Cambridge, Massachusetts, May 2004.Google Scholar
- Olin Shivers. Control-Flow Analysis of Higher-Order Languages or Taming Lambda. PhD thesis, Carnegie Mellon University, Pittsburgh, Pennsylvania, May 1991. Google Scholar
Digital Library
- Jeremy G. Siek and Walid Taha. Gradual typing for functional languages. In Scheme and Functional Programming Workshop, University of Chicago, Technical Report TR-2006-06, pages 81--92, September 2006.Google Scholar
- Jens Axel Søgaard. Galore, 2006. http://planet.plt-scheme.org/.Google Scholar
- Guy Lewis Steele Jr. Common Lisp-The Language. Digital Press, 1984. Google Scholar
Digital Library
- Audrey Tang. Perl 6: reconciling the irreconcilable. In POPL '07: Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 1--1, New York, NY, USA, 2007. ACM Press. http://pugscode.org. Google Scholar
Digital Library
- Sam Tobin-Hochstadt and Matthias Felleisen. Interlanguage migration: from scripts to programs. In OOPSLA '06: Companion to the 21st ACM SIGPLAN Conference on Object-oriented Programming Systems, Languages, and Applications, pages 964--974, New York, NY, USA, 2006. ACM Press. Google Scholar
Digital Library
- Christian Urban and Christine Tasson. Nominal Reasoning Techniques in Isabelle/HOL. In Proceedings of the 20th Conference on Automated Deduction (CADE 2005), volume 3632 of Lecture Notes in Artificial Intelligence. Springer, 2005. Google Scholar
Digital Library
- Dimitrios Vytiniotis, Stephanie Weirich, and Simon Peyton Jones. Boxy types: inference for higher-rank types and impredicativity. In ICFP '06: Proceedings of the Eleventh ACM SIGPLAN International Conference on Functional Programming, pages 251--262, New York, NY, USA, 2006. ACM Press. Google Scholar
Digital Library
- Philip Wadler and Robert Bruce Findler. Well-typed programs can't be blamed. In Proceedings of the Eighth Workshop on Scheme and Functional Programming, 2007.Google Scholar
- Mitchell Wand. A semantic prototyping system. In SIGPLAN '84: Proceedings of the 1984 SIGPLAN Symposium on Compiler Construction, pages 213--221, New York, NY, USA, 1984. ACM Press. Google Scholar
Digital Library
- A. Wright and B. Duba. Pattern matching for Scheme. Technical report, Rice University, May 1995.Google Scholar
- Andrew Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, pages 38--94, 1994. First appeared as Technical Report TR160, Rice University, 1991. Google Scholar
Digital Library
- Andrew K. Wright and Robert Cartwright. A practical soft type system for scheme. ACM Trans. Program. Lang. Syst., 19(1): 87--152, 1997. Google Scholar
Digital Library
Index Terms
The design and implementation of typed scheme
Recommendations
The design and implementation of typed scheme
POPL '08When scripts in untyped languages grow into large programs, maintaining them becomes difficult. A lack of types in typical scripting languages means that programmers must (re)discover critical pieces of design information every time they wish to change ...
A polymorphic modal type system for lisp-like multi-staged languages
POPL '06: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languagesThis article presents a polymorphic modal type system and its principal type inference algorithm that conservatively extend ML by all of Lisp's staging constructs (the quasi-quotation system). The combination is meaningful because ML is a practical ...
Interpretations of the gradually-typed lambda calculus
Scheme '12: Proceedings of the 2012 Annual Workshop on Scheme and Functional ProgrammingGradual typing is an approach to integrating static and dynamic type checking within the same language [Siek and Taha 2006]. Given the name "gradual typing", one might think that the most interesting aspect is the type system. It turns out that the ...







Comments