Research Article
Transposing F to C♯: expressivity of parametric polymorphism in an object-oriented language
Article first published online: 27 APR 2004
DOI: 10.1002/cpe.801
Copyright © 2004 John Wiley & Sons, Ltd.
Issue
1532-0634/asset/cover.gif?v=1&s=6094df24c795ce080ff6df6ff3b6bcec19adb708)
Concurrency and Computation: Practice and Experience
Special Issue: Formal Techniques for Java-like Programs
Volume 16, Issue 7, pages 707–733, June 2004
Additional Information
How to Cite
Kennedy, A. and Syme, D. (2004), Transposing F to C♯: expressivity of parametric polymorphism in an object-oriented language. Concurrency Computat.: Pract. Exper., 16: 707–733. doi: 10.1002/cpe.801
Publication History
- Issue published online: 27 APR 2004
- Article first published online: 27 APR 2004
- Manuscript Accepted: 13 JUN 2003
- Manuscript Received: 5 JAN 2003
- Abstract
- References
- Cited By
Keywords:
- polymorphism;
- Java, C♯;
- System F;
- closure conversion
Abstract
We present a type-preserving translation of System F (the polymorphic lambda calculus) into a forthcoming revision of the C♯ programming language supporting parameterized classes and polymorphic methods. The forthcoming revision of Java in JDK 1.5 also makes a suitable target. We formalize the translation using a subset of C♯ similar to Featherweight Java. We prove that the translation is fully type-preserving and that it preserves behaviour via the novel use of environment-style semantics for System F.
We observe that whilst parameterized classes alone are sufficient to encode the parameterized datatypes and let-polymorphism of languages such as ML and Haskell, it is the presence of dynamic dispatch for polymorphic methods that supports the encoding of the ‘first-class polymorphism’ found in System F and recent extensions to ML and Haskell. Copyright © 2004 John Wiley & Sons, Ltd.

1532-0634/asset/olbannerleft.gif?v=1&s=a4e4e145787de94e1d91eaab3c8c29d8a9d96a26)