Practical Soft Typing

dc.contributor.authorWright, Andrewen_US
dc.date.accessioned2017-08-02T22:03:24Zen_US
dc.date.available2017-08-02T22:03:24Zen_US
dc.date.issued1994-08en_US
dc.date.noteAugust 1994en_US
dc.descriptionThis work was also published as a Rice University thesis/dissertation: http://hdl.handle.net/1911/16900en_US
dc.description.abstractSoft typing is an approach to type checking for dynamically typed languages. Like a static type checker, a soft type checker infers syntactic types for identifiers and expressions. But rather than reject programs containing untypable fragments, a soft type checker inserts explicit run-time checks to ensure safe execution. Soft typing was first introduced in an idealized form by Cartwright and Fagan. This thesis investigates the issues involved in designing a practical soft type system. A soft type system for a purely functional, call-by-value language is developed by extending the Hindley-Milner polymorphic type system with recursive types and limited forms of union types. The extension adapts Remy's encoding of record types with sub-typing to union types. The encoding yields more compact types and permits more efficient type inference than Cartwright and Fagan's early technique. Correctness proofs are developed by employing a new syntactic approach to type soundness. As the type inference algorithm yields complex internal types that are difficult for programmers to understand, a more familiar language of presentation types is developed along with translations between internal and presentation types. To address realistic programming languages like Scheme, the soft type system is extended to incorporate assignment, continuations, pattern matching, data definition, records, modules, explicit type annotations, and macros. Imperative features like assignment and continuations are typed by anew, simple method of combining imperative features with Hindley-Milner polymorphism. The thesis shows soft typing to be practical by illustrating a prototype soft type system for Scheme. Type information determined by the prototype is sufficiently precise to provide useful diagnostic aid to programmers and to effectively minimize run-time checking. The type checker typically eliminates 90% of the run-time checks that are necessary for safe execution with dynamic typing. This reduction in runtime checking leads to significant speedup for some bench marks. Through several examples, the thesis shows how prototypes, developed using a purely semantic understanding of types as sets of values, can be transformed into robust maintainable, and efficient programs by rewriting them to accommodate better syntactic type assignment.en_US
dc.format.extent169 ppen_US
dc.identifier.citationWright, Andrew. "Practical Soft Typing." (1994) https://hdl.handle.net/1911/96444.en_US
dc.identifier.digitalTR94-236en_US
dc.identifier.urihttps://hdl.handle.net/1911/96444en_US
dc.language.isoengen_US
dc.rightsYou are granted permission for the noncommercial reproduction, distribution, display, and performance of this technical report in any format, but this permission is only for a period of forty-five (45) days from the most recent time that you verified that this technical report is still available from the Computer Science Department of Rice University under terms that include this permission. All other rights are reserved by the author(s).en_US
dc.titlePractical Soft Typingen_US
dc.typeTechnical reporten_US
dc.type.dcmiTexten_US
Files
Original bundle
Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
TR94-236.pdf
Size:
6.68 MB
Format:
Adobe Portable Document Format