A Practical Type Checker for Scheme Style |a Practical Type Checker for Scheme

This paper describes an new tool for nding errors in R 4 RS-compliant Scheme programs. A polymorphic type system in the style of Damas & Milner (1982) with an additional maximum type is used to type Scheme code. Although Scheme is dynamically typed, most parts of programs are statically typeable; type inconsistencies are regarded as hints to possible programming errors. The paper rst introduces a type system which is a careful balance between rigorous type safety and pragmatic type softness. An eecient and portable implementation based on order sorted uniication in Scheme is then described. We obtained very satisfactory results on realistic programs, including the programs in Abelson, Sussman & Sussman (1985).