Results 1 -
9 of
9
A Practical Soft Type System for Scheme
- In Proceedings of the 1994 ACM Conference on LISP and Functional Programming
, 1993
"... Soft type systems provide the benefits of static type checking for dynamically typed languages without rejecting untypable programs. A soft type checker infers types for variables and expressions and inserts explicit run-time checks to transform untypable programs to typable form. We describe a prac ..."
Abstract
-
Cited by 103 (4 self)
- Add to MetaCart
Soft type systems provide the benefits of static type checking for dynamically typed languages without rejecting untypable programs. A soft type checker infers types for variables and expressions and inserts explicit run-time checks to transform untypable programs to typable form. We describe a practical soft type system for R4RS Scheme. Our type checker uses a representation for types that is expressive, easy to interpret, and supports efficient type inference. Soft Scheme supports all of R4RS Scheme, including procedures of fixed and variable arity, assignment, continuations, and top-level definitions. Our implementation is available by anonymous FTP. The first author was supported in part by the United States Department of Defense under a National Defense Science and Engineering Graduate Fellowship. y The second author was supported by NSF grant CCR-9122518 and the Texas Advanced Technology Program under grant 003604-014. 1 Introduction Dynamically typed languages like Scheme...
Polymorphic Splitting: An Effective Polyvariant Flow Analysis
- ACM Transactions on Programming Languages and Systems
, 1998
"... values for our framework are defined as follows: a 2 Avalue = Aconst +Aclosure b 2 Aconst = ftrue; false; number; nilg hl; ae; i 2 Aclosure = Label \Theta Aenv \Theta Contour ae 2 Aenv = Var fin \Gamma! Contour 2 Contour = Label An abstract value a is a set of abstract constants and abstra ..."
Abstract
-
Cited by 21 (0 self)
- Add to MetaCart
values for our framework are defined as follows: a 2 Avalue = Aconst +Aclosure b 2 Aconst = ftrue; false; number; nilg hl; ae; i 2 Aclosure = Label \Theta Aenv \Theta Contour ae 2 Aenv = Var fin \Gamma! Contour 2 Contour = Label An abstract value a is a set of abstract constants and abstract closures. The abstract constants true and false each denote a single exact value, while the abstract constant number denotes a set of exact values. An abstract closure hl; ae; i identifies procedures created from the -expression (lambda (x 1 : : : xn) e b ) l . The contour of an abstract closure, paired with an argument x i or a label of a subexpression of e b , determines the program points for the body of the abstract closure. Thus two abstract closures that share the same label but use different contours will have different program points. The abstract environment ae of an abstract closure records the contours in which its free variables are bound. Our polymorphic splitting analy...
Analysis of Recursive Types in an Imperative Language
, 1994
"... Analysis of Recursive Types in an Imperative Language by Edward Yan-Bing Wang Doctor of Philosophy in Computer Science University of California at BERKELEY Professor Paul N. Hilfinger, Chair I introduce Algorithm P and p-set, a new type-analysis algorithm and its associated type description, capable ..."
Abstract
-
Cited by 13 (0 self)
- Add to MetaCart
Analysis of Recursive Types in an Imperative Language by Edward Yan-Bing Wang Doctor of Philosophy in Computer Science University of California at BERKELEY Professor Paul N. Hilfinger, Chair I introduce Algorithm P and p-set, a new type-analysis algorithm and its associated type description, capable of deducing and accurately representing recursive types in programs in an imperative language, using type information present in both object creation and object use. When applied to Lisp and used to discover unnecessary type checks, Algorithm P is capable of removing close to all of the type checks on structured objects in most programs. Professor Paul N. Hilfinger Dissertation Committee Chair iii To my parents iv Acknowledgements I thank my advisor, Paul Hilfinger, and the other members of the committee, Alex Aiken and Phil Colella. Marcia Feitel helped in the writing of this report, in both content and style, and in English and Latin. The research documented here was in part support...
Practical Soft Typing
, 1994
"... Soft 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 t ..."
Abstract
-
Cited by 10 (1 self)
- Add to MetaCart
Soft 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 subtyping 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 app...
Style - A Practical Type Checker for Scheme
, 1993
"... This paper describes an new tool for finding 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 ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
This paper describes an new tool for finding 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 first introduces a type system which is a careful balance between rigorous type safety and pragmatic type softness. An efficient and portable implementation based on order sorted unification in Scheme is then described. We obtained very satisfactory results on realistic programs, including the programs in Abelson, Sussman & Sussman (1985). 1 Introduction Finding errors in Scheme programs is painful. One major reason is that Scheme is a dynamically typed language: all names in Scheme programs can hold objects of arbitrary, undeclared type which may change during runtime. Unlike most modern languages like H...
The Nimble Type Inferencer for Common Lisp-84
- Tech. Rept., Nimble Comp
, 1990
"... data types model the semantic intent of the programmer with respect to individual variable values, so that global properties of these individual values (e.g., evenness or primeness of an integer value) are maintained. The assert construct allows for the specification of complex relationships among s ..."
Abstract
- Add to MetaCart
data types model the semantic intent of the programmer with respect to individual variable values, so that global properties of these individual values (e.g., evenness or primeness of an integer value) are maintained. The assert construct allows for the specification of complex relationships among several variables. However, since we are interested in improving run-time efficiency, we will assume that the program is already semantically correct, and will therefore concern ourselves only with the determination of tight lattice bounds on the values of variables. Performing type inference requires proving many small theorems about programs, and therefore runs the risk of being confused with the more difficult task of theorem-proving for the purpose of proving programs correct relative to some external criteria. While some of the techniques may be similar to both tasks, the goals are completely different. For example, it is considered acceptable and routine for correctness provers to inte...
A Practical Approach to Type Inference for EuLisp
- Lisp and Symbolic Computation
, 1993
"... . Lisp applications need to show a reasonable cost-benefit relationship between the offered expressiveness and their demand for storage and run-time. Drawbacks in efficiency, apparent in Lisp as a dynamically typed programming language, can be avoided by optimizations. Statically inferred type infor ..."
Abstract
- Add to MetaCart
. Lisp applications need to show a reasonable cost-benefit relationship between the offered expressiveness and their demand for storage and run-time. Drawbacks in efficiency, apparent in Lisp as a dynamically typed programming language, can be avoided by optimizations. Statically inferred type information can be decisive for the success of these optimizations. This paper describes a practical approach to type inference realized in a module and application compiler for EuLisp. The approach is partly related to Milner-style polymorphic type inference, but differs by describing functions with generic type schemes. Dependencies between argument and result types can be expressed more precisely by using generic type schemes of several lines than by using the common one-line type schemes. Generic type schemes contain types of a refined complementary lattice and bounded type variables. Besides standard and defined types so-called strategic types (e.g. singleton, zero, number-list) are combine...
Analysis of Recursive Types in Lisp-like Languages
- In LFP 1992 [29
"... We introduce a new algorithm to analyze recursive, structured types. It derives information from object uses (accesser functions with type checking), as well as from object allocation. The type description is a form of graph grammar and is naturally finite even in the presence of loops. The intended ..."
Abstract
- Add to MetaCart
We introduce a new algorithm to analyze recursive, structured types. It derives information from object uses (accesser functions with type checking), as well as from object allocation. The type description is a form of graph grammar and is naturally finite even in the presence of loops. The intended use of the algorithm is to discover and remove unnecessary type checks, but it can be augmented to provide alias information as well. 1 Introduction We are interested in the behavior of programs in an untyped language with data structures constructed from records containing pointers, typified by Lisp programs that manipulate structures built from cons cells. In this paper, we will introduce a new algorithm to analyze such programs. Unlike many type-inference algorithms, it is designed to work on partial programs (with or without declarations) and to produce partial inferences. The main goal is to remove unnecessary type checks. The algorithm uses information from both object creation and t...
A Practical Approach to Type Inference in EuLisp
, 1993
"... . Lisp applications need to show a reasonable cost-benefit relationship between the offered expressiveness and their demand for storage and run-time. Drawbacks in efficiency, apparent in Lisp as a dynamically typed programming language, can be avoided by doing compiling optimizations. Statically inf ..."
Abstract
- Add to MetaCart
. Lisp applications need to show a reasonable cost-benefit relationship between the offered expressiveness and their demand for storage and run-time. Drawbacks in efficiency, apparent in Lisp as a dynamically typed programming language, can be avoided by doing compiling optimizations. Statically inferred type information can be decisive for the success of these optimizations. This paper describes a practical approach to type inference used in a module and application compiler for EuLisp. The approach is related to Milner-style polymorphic type inference, but differs by handling refined types, e.g., cons-nodes, recursive lists, structures, classes, singleton types and fine-grained number types, in the absence of type declarations. Due to module compilation inferred type signatures of exported functions are provided in export interfaces, in order to reuse them for later import. The type inference is integrated with the process of compilation to make use of information previously analyse...

