Existential Types for Imperative Languages
نویسنده
چکیده
We integrate existential types into a strongly typed C-like language. In particular, we show how a bad combination of existential types, mutation, and aliasing can cause a subtle violation of type safety. We explore two independent ways to strengthen the type system to restore safety. One restricts the mutation of existential packages. The other restricts the types of aliases of existential packages. We use our framework to explain why other languages with existential types are safe.
منابع مشابه
Existential Types for Imperative Languages: Technical Results
This technical report contains the full type-safety proof for the language presented in the paper Existential Types for Imperative Languages, originally submitted for publication in October 2001. Because this report should be read only after the paper, effectively as an appendix, we do not repeat the motivation, examples, and informal presentation contained there. Also refer to the paper for re...
متن کاملPattern Matching via Choice Existential Quantifications in Imperative Languages
Selection statements – if-then-else, switch and try-catch – are commonly used in modern imperative programming languages. We propose another selection statement called a choice existentially quantified statement. This statement turns out to be quite useful for pattern matching among several merits. Examples will be provided for this statement. keywords: selection, pattern matching, choice quant...
متن کاملDynamic Typing in Polymorphic Languages Dynamic Typing in Polymorphic Languages Digital Equipment Corporation 1994
matching protects the identity of \hidden" representation types and prevents accidental matches in cases where several abstract types happen to have the same representation. On the other hand, transparent matching allows a more permissive style of programming, where a dynamically typed value of some abstract type is considered to be a value of a di erent version of \the same" abstract type. Thi...
متن کاملRescuing Existential Free Choice Items in Episodic Sentences
Note here that this subtrigging strategy does not work for all types of FCIs. Chierchia (2005) points out that, in Italian, subtrigging rescues the universal type of FCI qualsiasi, but not the existential counterpart uno qualsiasi. The same contrast holds for other Romance languages like Spanish: adding a relative clause improves the universal FCI cualquier in (4), but not the existential FCI u...
متن کاملCompiling with Polymorphic and Polyvariant Flow Types
Optimizing compilers for function-oriented and object-oriented languages exploit type and flow information for efficient implementation. Although type and flow information (both control and data flow) are inseparably intertwined, compilers usually compute and represent them separately. Partially, this has been a result of the usual polymorphic type systems using ∀ and ∃ quantifiers, which are d...
متن کامل