An unboxed operational semantics for ML polymorphism

Atsushi Ohori, Tomonobu Takamizawa

Research output: Contribution to journalArticlepeer-review

1 Citation (Scopus)

Abstract

We present an unboxed operational semantics for an ML-style polymorphic language. Different from the conventional formalisms, the proposed semantics accounts for actual representations of run-time objects of various types, and supports a refined notion of polymorphism that allows polymorphic functions to be applied directly to values of various different representations. In particular, polymorphic functions can receive multiword constants such as floating-point numbers without requiring them to be "boxed" (i.e., heap allocated.) This semantics will serve as an alternative basis for implementing polymorphic languages. The development of the semantics is based on the technique of the type-inference-based compilation for polymorphic record operations [20]. We first develop a lower-level calculus, called a polymorphic unboxed calculus, that accounts for direct manipulation of unboxed values in a polymorphic language. This unboxed calculus supports efficient value binding through integer representation of variables. Different from de Bruijn indexes, our integer representation of a variable corresponds to the actual offset to the value in a run-time environment consisting of objects of various sizes. Polymorphism is supported through an abstraction mechanism over argument sizes. We then develop an algorithm that translates ML into the polymorphic unboxed calculus by using type information obtained through type inference. At the time of polymorphic let binding, the necessary size abstractions are inserted so that a polymorphic function is translated into a function that is polymorphic not only in the type of the argument but also in its size. The ML type system is shown to be sound with respect to the operational semantics realized by the translation.

Original languageEnglish
Pages (from-to)61-91
Number of pages31
JournalHigher-Order and Symbolic Computation
Volume10
Issue number1
Publication statusPublished - 1997 Dec 1
Externally publishedYes

Keywords

  • ML
  • Operational semantics
  • Polymorphism
  • Type inference
  • Unboxed objects

ASJC Scopus subject areas

  • Software
  • Computer Science Applications

Fingerprint Dive into the research topics of 'An unboxed operational semantics for ML polymorphism'. Together they form a unique fingerprint.

Cite this