|
ABSTRACT
An important implementation decision in polymorphically typed functional programming language is whether to represent data in boxed or unboxed form and when to transform them from one representation to the other. Using a language with explicit representation types and boxing/unboxing operations we axiomatize equationally the set of all explicitly boxed versions, called completions, of a given source program. In a two-stage process we give some of the equations a rewriting interpretation that captures eliminating boxing/unboxing operations without relying on a specific implementation or even semantics of the underlying language. The resulting reduction systems operate on congruence classes of completions defined by the remaining equations E, which can be understood as moving boxing/unboxing operations along data flow paths in the source program. We call a completion eopt formally optimal if every other completion for the same program (and at the same representation type) reduces to eopt under this two-stage reduction.
We show that every source program has formally optimal completions, which are unique modulo E. This is accomplished by first “polarizing” the equations in E and orienting them to obtain two canonical (confluent and strongly normalizing) rewriting systems. The completions produced by Leroy's and Poulsen's algorithms are generally not formally optimal in our sense.
The rewriting systems have been implemented and applied to some simple Standard ML programs. Our results show that the amount of boxing and unboxing operations is also in practice substantially reduced in comparison to Leroy's completions. This analysis is intended to be integrated into Tofte's region-based implementation of Standard ML currently underway at DIKU.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
 |
BGS82
|
Rodney A. Brooks , Richard P. Gabriel , Guy L. Steele, Jr., An optimizing compiler for lexically scoped LISP, Proceedings of the 1982 SIGPLAN symposium on Compiler construction, p.261-275, June 23-25, 1982, Boston, Massachusetts, United States
|
| |
Bjø92
|
Niko}aj Bjerner. Minimal typing derivations. DIKU Student Report, July 1992.
|
| |
BTCGS91
|
|
 |
BTGS90
|
|
 |
CF91
|
|
| |
CG90
|
|
 |
DM82
|
|
| |
Ghe90
|
G. Ghelli. Proof Theoretic Studies about a Minimal Type System Integrating Inclusion and Parametric Polymorphism. PhD thesis, Universita di Piss, Dipartimento di informatica, March 1990.
|
| |
Hen93
|
|
 |
HM93
|
|
 |
KKR+86
|
David Kranz , Norman Adams , Richard Kelsey , Jonathan Rees , Paul Hudak , James Philbin, ORBIT: an optimizing compiler for scheme, Proceedings of the 1986 SIGPLAN symposium on Compiler construction, p.219-233, June 25-27, 1986, Palo Alto, California, United States
|
 |
Ler92
|
|
| |
Mil78
|
R. Milner. A theory of type polymorphism in programming. J. Computer and System Sciences, 17:348-375, 1978.
|
 |
Pet89
|
|
| |
PJL91
|
|
| |
Pou93
|
Eigil Poulsen. Representation analysis for efficient implementation of polymorphism. Master's thesis, DIKU, University of Copenhagen, 1993.
|
| |
Rey83
|
J. Reynolds. Types, abstraction and parametric polymorphism. Information Processing, pages 513-523, 1983.
|
| |
Ste77
|
G. Steele. Fast arithmetic in MacLisp. In Proc. 1977 MACSYMA Users' Conference, NASA Scientific and Technical Information Office, Washington, D.C., July 1977.
|
 |
TT94
|
|
 |
Wad89
|
|
| |
WF92
|
A. Wright and M. Fagan. Soft typing and global representation optimization. Manuscript, July 1992.
|
CITED BY 15
|
|
D. Tarditi , G. Morrisett , P. Cheng , C. Stone , R. Harper , P. Lee, TIL: a type-directed optimizing compiler for ML, ACM SIGPLAN Notices, v.31 n.5, p.181-192, May 1996
|
|
|
|
|
|
Lars Birkedal , Mads Tofte , Magnus Vejlstrup, From region inference to von Neumann machines via region representation inference, Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.171-183, January 21-24, 1996, St. Petersburg Beach, Florida, United States
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
David Tarditi , Greg Morrisett , Perry Cheng , Chris Stone , Robert Harper , Peter Lee, TIL: a type-directed, optimizing compiler for ML, ACM SIGPLAN Notices, v.39 n.4, April 2004
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
REVIEW
"R. Sambasiva Rao : Reviewer"
LISP is a dynamically typed high-level language, while Standard ML
and Haskell are statically typed polymorphic languages. The type of
representation of data and the mode of implementation in a program
result in different efficiencies when the
more...
|