Unboxed values and polymorphic typing revisited

Peter J. Thiemann · 1995

Traditional implementations of polymorphic languages require that values passed to polymorphic functions all have a representation of the same size.If the natural representation of a value does not fit this size it 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 defined 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.

Read the paper · More papers on PaperTik