Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Polymorphic typed defunctionalization
Pottier F., Gauthier N. ACM SIGPLAN Notices39 (1):89-98,2004.Type:Article
Date Reviewed: Mar 11 2004

The issue of defunctionalization with type preservation is addressed in this paper. Defunctionalization is a program transformation that turns a higher-order functional program into a first-order functional program (with no functions as first-order values). The purpose of this transformation is similar to that of closure conversion, but it differs by storing a tag instead of a code pointer within every closure. Defunctionalization serves both as a reasoning tool and as a compilation technique.

Defunctionalization is defined and studied most commonly in the setting of a simply typed lambda-calculus, where semantics and well typedness are preserved. With polymorphic type systems, as in ML or System F, defunctionalization is not type-preserving. The authors extend System F with guarded algebraic data types to preserve types.

The problem with defining defunctionalization for a typed-polymorphic lambda-calculus lies in the definition of “apply” that simulates the application of a source function to a source value, then returning its result. The main contribution of this paper is its proof that defunctionalization may be viewed as a type-preserving transformation from System F, as extended with guarded algebraic data types, into itself. Also noted is a similar process that can be applied to ML. Another contribution of this paper is its proof that the transformation is meaning-preserving in an untyped setting; this result can then be lifted to the typed setting.

After a carefully prepared introduction, the second section defines the extension of System F with guarded algebraic data types. The third section defines the defunctionalization of well-typed programs, and the fourth section includes a proof that defunctionalization of untyped programs preserves well typedness. The fifth section defines the defunctionalization of untyped programs, and includes a proof of meaning preservation, which also carries over to typed programs. The last section contains closing remarks.

The authors’ version of defunctionalization does not address optimization or a sophisticated treatment of multiple-argument functions, but it does broaden the case for defunctionalization as a compilation technique, and as a tool to help programmers transform programs and reason about them. The paper is rigorous, well written, and includes sufficient detail to satisfy functional language theorists.

Reviewer:  M. G. Murphy Review #: CR129233 (0409-1081)
Bookmark and Share
  Featured Reviewer  
 
Polymorphism (D.3.3 ... )
 
 
Compilers (D.3.4 ... )
 
 
Procedures, Functions, And Subroutines (D.3.3 ... )
 
 
Type Structure (F.3.3 ... )
 
 
Language Constructs and Features (D.3.3 )
 
 
Processors (D.3.4 )
 
Would you recommend this review?
yes
no
Other reviews under "Polymorphism": Date
Formalization of generics for the .NET common language runtime
Yu D., Kennedy A., Syme D. ACM SIGPLAN Notices 39(1): 39-51, 2004. Type: Article
Mar 10 2004
Parametric polymorphism for XML
Hosoya H., Frisch A., Castagna G.  Principles of programming languages (Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Long Beach, California, USA, Jan 12-14, 2005)50-62, 2005. Type: Proceedings
Apr 7 2005
Safe instantiation in generic Java
Allen E., Cartwright R. Science of Computer Programming 59(1-2): 26-37, 2006. Type: Article
Jul 19 2006
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy