The Design and Implementation of Typed Scheme: From Scripts to Programs
Sam Tobin-Hochstadt, Matthias Felleisen

TL;DR
Typed Scheme introduces an explicitly typed extension to an untyped scripting language, using occurrence typing and refinement types to improve program maintainability and correctness.
Contribution
It presents a novel type system based on occurrence typing, formalizes it, and demonstrates its implementation in Typed Scheme with refinement types and subtyping.
Findings
Type system is sound and formalized
Refinement types enable precise value tracking
Implementation improves program safety and maintainability
Abstract
When scripts in untyped languages grow into large programs, maintaining them becomes difficult. A lack of explicit type annotations in typical scripting languages forces programmers to 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 PLT Scheme, 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. The formulation of occurrence typing…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Software Engineering Research · Formal Methods in Verification
