## Unboxed Values and Polymorphic Typing Revisited (1995)

### Cached

### Download Links

- [www-pu.informatik.uni-tuebingen.de]
- [www.informatik.uni-freiburg.de]
- DBLP

### Other Repositories/Bibliography

Venue: | In The Seventh International Conference on Functional Programming Languages and Computer Architecture |

Citations: | 12 - 0 self |

### BibTeX

@INPROCEEDINGS{Thiemann95unboxedvalues,

author = {Peter J. Thiemann},

title = {Unboxed Values and Polymorphic Typing Revisited},

booktitle = {In The Seventh International Conference on Functional Programming Languages and Computer Architecture},

year = {1995},

pages = {24--35},

publisher = {ACM Press}

}

### Years of Citing Articles

### OpenURL

### Abstract

Polymorphic languages require that values passed to polymorphic functions all have a representation of the same size. Any value whose natural representation does not fit this size must be boxed, i.e. represented by a pointer to a heap-allocated record. Major performance gains can be achieved by handling values in their natural, unboxed representation whenever possible. We show that not only monomorphic functions, but also many polymorphic functions can handle unboxed values if the function calling convention of the underlying implementation satisfies a mild assumption. A representation type system is deøned which describes boxing requirements. A type reconstruction algorithm is given which translates an untyped program into an explicitly typed program where all changes of representation are made explicit. Furthermore, we define an abstract machine which employs the required calling convention and is an adequate operational model for the representation type system.

### Citations

936 | A theory of type polymorphism in progra.mming
- Milner
- 1978
(Show Context)
Citation Context ... a function is assigned the tag fPg. The latter assignment is achieved by passing the required tag as another parameter similar to an inherited attribute. The main dioeerences to Milner's algorithm W =-=[13] are the-=- dioeerent uni��cation algorithm, the propagation of tags, the modi��ed generalization mechanism, and the transformed expression as an additional result. The type reconstruction and transforma... |

620 |
Compiling with Continuations
- Appel
- 1992
(Show Context)
Citation Context ...ir caller. In a CPS transformation there is a choice on which argument comes ��rst. In Fischer's original transformation [5] the continuation argument comes ��rst, in the one apparently used b=-=y Appel [1] in -=-the SML/NJ compiler the continuation argument comes last. Let's consider with an example what happens if a compiler employs a CPS transformation which places the continuation argument ��rst. The B... |

536 |
The Implementation of Functional Programming Languages
- Jones
- 1987
(Show Context)
Citation Context ...r m ? 1 the generic representation is a heap-allocated record where the ��rst word holds a tag value which discriminates the dioeerent summands and the rest has the same layout as the respectives�=-=��� i [1, 15]-=-. E.g. in a stack-based implementation the unboxed representation of such a value could put the tag value on top on the stack and the components below [14]. However, passing such a value requires cond... |

358 |
Principal type-schemes for functional programs
- Damas, Milner
- 1982
(Show Context)
Citation Context ...de��nes types �� and type schemes oe by �� ::= ff j b j �� 1 ! �� 2 oe ::= �� j 8ff : oe where ff is a type variable and b a base type. Typing judgements for ML-expressions hav=-=e the form A `DM e : oe [4] and-=- A ` s DM : �� for the syntax-directed version [2]. Their inference rules are standard and therefore omitted. 1 Using the transformation of Sabry and Felleisen [18]. 3.2 Representation Types The l... |

344 | How to make ad-hoc polymorphism less ad hoc
- Wadler, Blott
- 1989
(Show Context)
Citation Context ...and ae 3 are passable types we are done. Otherwise �� 1 fae 2 ; ae 3 g must be parameterized again and propagated further. A similar goal could be achieved through overloading similar to type clas=-=ses [21, 7, 10]. De��ne-=- a type class R \Theta with pair, �� 1 , and �� 2 as member functions. The (implicit) instances of R \Theta are all ae 1 \Theta ae 2 where ae 1 and ae 2 are passable types. 7.2 Algebraic Types... |

170 | Unboxed objects and polymorphic typing
- Leroy
- 1992
(Show Context)
Citation Context ...sters. Hence, it is advantageous to handle values in their unboxed representation wherever possible and to put values iin the boxj only if they are passed to a polymorphic function. The work of Leroy =-=[11]-=- ooeers experimental data which shows that the gain of so doing can be substantial. He wraps polymorphic functions into coercions (functions which change the representation) such that types which inst... |

161 | Reasoning about programs in continuation-passing style
- Sabry, Felleisen
- 1993
(Show Context)
Citation Context ...sions have the form A `DM e : oe [4] and A ` s DM : �� for the syntax-directed version [2]. Their inference rules are standard and therefore omitted. 1 Using the transformation of Sabry and Fellei=-=sen [18]-=-. 3.2 Representation Types The language of representation types distinguishes boxed and unboxed types. It is conveniently modelled as the set of order-sorted terms [12] over the four element upper sem... |

123 |
The categorical abstract machine
- Cousineau, Curien, et al.
- 1987
(Show Context)
Citation Context ...on of Core-XML on the EV-machine, which is de��ned below, satis��es the parameter passing assumption and is therefore an adequate operational model for representation typing. It is similar to =-=the CAM [3]-=-. A machine state is a triple ChE;V i of code C, an environment E, and a value V . V is used for passing the parameter to a function and to hold the return value of a function. The environment E is a ... |

100 | Lambda calculus schemata
- Fischer
- 1972
(Show Context)
Citation Context ...ion) All function calls in tail position are implemented by the equivalent of a jump instruction. Tail call elimination can be captured by means of a transformation to continuation-passing style (CPS =-=[5]-=-). In continuation-passing style, functions never return, instead they pass their result to the continuation which is explicitly passed as an additional argument. Then a function can return an unboxed... |

96 |
A simple applicative language: Mini-ML
- Clement, Despeyroux, et al.
- 1986
(Show Context)
Citation Context ...j �� 1 ! �� 2 oe ::= �� j 8ff : oe where ff is a type variable and b a base type. Typing judgements for ML-expressions have the form A `DM e : oe [4] and A ` s DM : �� for the syntax-d=-=irected version [2]-=-. Their inference rules are standard and therefore omitted. 1 Using the transformation of Sabry and Felleisen [18]. 3.2 Representation Types The language of representation types distinguishes boxed an... |

38 |
Formally optimal boxing
- Henglein, J0rgensen
- 1994
(Show Context)
Citation Context ... Wrapping id in suitable coercions yields: abs (unbox real (id (box real x))) This is equivalent to what Leroy's algorithm does and it also forms the basic assumption of other work in this area, e.g. =-=[16, 17, 8]-=-. Without making any assumptions on the execution model it is indeed necessary to insist on binding generic type variables to boxed representation types only. However, there is room for improvement. T... |

17 | Partial evaluation for dictionary-free overloading
- Jones
- 1994
(Show Context)
Citation Context ...and ae 3 are passable types we are done. Otherwise �� 1 fae 2 ; ae 3 g must be parameterized again and propagated further. A similar goal could be achieved through overloading similar to type clas=-=ses [21, 7, 10]. De��ne-=- a type class R \Theta with pair, �� 1 , and �� 2 as member functions. The (implicit) instances of R \Theta are all ae 1 \Theta ae 2 where ae 1 and ae 2 are passable types. 7.2 Algebraic Types... |

10 |
Coercive type isomorphism
- Thatte
- 1991
(Show Context)
Citation Context ...n unboxed tuple. They rely on programmer supplied annotations to functions and data type declarations. Thatte de��nes a very general framework for typing in the presence of isomorphisms between ty=-=pes [20]-=-. The isomorphisms induce a non-trivial equational theory on the type language. Our type reconstruction algorithm may be seen as an application of his framework adapted to an order-sorted type languag... |

8 |
Unboxed values as rst class citizens in a non-strict functional language
- Jones, Launchbury
- 1991
(Show Context)
Citation Context ... Wrapping id in suitable coercions yields: abs (unbox real (id (box real x))) This is equivalent to what Leroy's algorithm does and it also forms the basic assumption of other work in this area, e.g. =-=[16, 17, 8]-=-. Without making any assumptions on the execution model it is indeed necessary to insist on binding generic type variables to boxed representation types only. However, there is room for improvement. T... |

7 | Compiling with non-parametric polymorphism (preliminary report
- Harper, Morrisett
- 1994
(Show Context)
Citation Context ...lements recursively. Poulsen's global representation analysis [17] requires that list elements are boxed as far as any polymorphic function which is applied to the list requires. Harper and Morrisett =-=[6]-=- propose to keep all list elements unboxed and to compute the access functions on the AEy from type applications. This requires non-trivial computations to be performed at type applications. We propos... |

3 |
Partially strict non-recursive data types
- Nocker, Smetsers
- 1993
(Show Context)
Citation Context ...as the same layout as the respectives�� i [1, 15]. E.g. in a stack-based implementation the unboxed representation of such a value could put the tag value on top on the stack and the components be=-=low [14]-=-. However, passing such a value requires conditional code since the contents of the stack depend on the tag value. That is only acceptable if the unboxed value is the subject expression of a case-expr... |

3 |
A many-sorted calculus with polymorphic functions based on resolution and paramodulation
- Schmidt-Schau
- 1985
(Show Context)
Citation Context ... the syntactic most general uni��er of CC(E 0 ) (a coercion term). Notice, that order-sorted uni��cation need not be unitary (not even ��nitary) in general and that the general problem is =-=NP-complete [19]. Th-=-e reason is that symbols may be overloaded, i.e. they may have more than one sorting. Since we do not use that feature, our uni��cation problem can be solved in quasi-linear time (see [12]). 4.2 R... |

1 |
Order-sorted uni��cation
- Meseguer, Goguen, et al.
- 1989
(Show Context)
Citation Context ...ormation of Sabry and Felleisen [18]. 3.2 Representation Types The language of representation types distinguishes boxed and unboxed types. It is conveniently modelled as the set of order-sorted terms =-=[12]-=- over the four element upper semi-lattice B = (fU; B; H;?g;) shown in the Hasse-diagram below. Q Q j j U H B ? The elements U and B denote the sorts of unboxed and boxed types, respectively, the eleme... |

1 |
Representation analysis for eOEcient implementation of polymorphism
- Poulsen
- 1993
(Show Context)
Citation Context ... Wrapping id in suitable coercions yields: abs (unbox real (id (box real x))) This is equivalent to what Leroy's algorithm does and it also forms the basic assumption of other work in this area, e.g. =-=[16, 17, 8]-=-. Without making any assumptions on the execution model it is indeed necessary to insist on binding generic type variables to boxed representation types only. However, there is room for improvement. T... |