Compiling with Non-Parametric Polymorphism

نویسنده

  • Robert Harper
چکیده

There is a middle ground between parametric and ad-hoc polymorphism in which a computation can depend upon a type parameter but is restricted to being de ned at all types in an inductive fashion. We call such polymorphism non-parametric. We show how nonparametric polymorphism can be used to implement a variety of useful language mechanisms including overloading, unboxed data representations in the presence of ML-style polymorphism, and canonical representations of equivalent types. We show that, by using a second-order, explicitly typed language extended with non-parametric operations, these mechanisms can be implemented without having to tag data with type information at runtime. Furthermore, this approach retains a \phase distinction" and permits static type checking and separate compilation. Our aim is to provide a unifying language, translation, and proof framework in which a variety of non-parametric mechanisms can be expressed and veri ed.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Parametricity as Subtyping (preliminary Report)

A polymorphic function is parametric if it has uniform behavior for all type parameters. This property is useful when writing, reasoning about, and compiling functional programs. We show how to syntactically deene and reason about parametricity in a language with intersection types and bounded polymorphism. Within this framework, parametricity is subtyping, and reasoning about para-metricity be...

متن کامل

Modular polymorphic defunctionalization

Defunctionalization is generally considered a whole-program transformation and thus incompatible with separate compilation. In this paper, we formalize a modular variant of defunctionalization which can support separate compilation for a functional programming language with parametric polymorphism. Our technique allows modules in a Haskell-like language to be separately defunctionalized and com...

متن کامل

Family Resemblance vs. Polymorphism

CONTENTS SUMMARY "Measure boundary" concepts for domains with a metric Use of task-related boundary Metrical and non-metrical concepts, and polymorphism Parametric polymorphism in biological designs Family Resemblance Ryle’s Polymorphism Parametric polymorphism in computer science Exercises for the reader Evolution and parametric polymorphism Programming languages with parametric polymorphism M...

متن کامل

On the construction of persistent programming environments

This thesis presents research into the construction of persistent programming systems. Much of the thesis is concerned with the design and implementation of persistent programming languages, in particular PS-algol and Napier. Both languages support machine independent vector and raster graphics data types. Napier provides an environment mechanism that enables the incremental construction and bi...

متن کامل

From parametric polymorphism to models of polymorphic FPC

This paper shows how PILLY (Polymorphic Intuitionistic / Linear Lambda calculus with a fixed point combinator Y ) with parametric polymorphism can be used as a metalanguage for domain theory, as originally suggested by Plotkin more than a decade ago. Using Plotkin’s encodings of recursive types in PILLY we show how parametric models of PILLY give rise to models of FPC, a simply typed lambda cal...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1994