Compiling ML polymorphism with explicit layout bitmap

Huu Duc Nguyen, Atsushi Ohori

Research output: Chapter in Book/Report/Conference proceedingConference contribution

6 Citations (Scopus)

Abstract

Most of the current implementations of functional languages adopt so-called "tagged data representations" to support tracing garbage collection. The representations impose a burden of data conversion on the runtime performance and the interoperability between ML and other languages. In this paper, we present a type-directed compilation method for ML polymorphism that supports natural representations of integers and other atomic data. This is achieved by compiling ML so that each runtime object (a heap block or a stack frame) has a "bitmap" that describes the pointer positions in the block. Since a polymorphic function may produce runtime objects of different types, the compiler needs to compute appropriate bitmaps for each instantiation of the function. This would require us to insert extra lambda abstractions and applications to pass the bits required in bitmap calculations. This compilation process should be done for both stack frames and heap-allocated objects including functions' closures and their environment records. We solve these problems by combining the type-directed compilation method with typed closure conversion, and type-preserving A-normalization. The resulting compilation process is shown to be sound with respect to an untyped operational semantics with bitmap-inspecting garbage collection. The proposed compilation method has been implemented for the full Standard ML Language, demonstrating its practical feasibility.

Original languageEnglish
Title of host publicationPPDP'06 - Proceedings of the Eight ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming
PublisherAssociation for Computing Machinery
Pages237-248
Number of pages12
ISBN (Print)1595933883, 9781595933881
DOIs
Publication statusPublished - 2006
EventPPDP'06 - 8th ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming - Venice, Italy
Duration: 2006 Jul 102006 Jul 12

Publication series

NamePPDP'06 - Proceedings of the Eight ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming
Volume2006

Other

OtherPPDP'06 - 8th ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming
CountryItaly
CityVenice
Period06/7/1006/7/12

Keywords

  • Garbage collection
  • Memory management
  • Polymorphism
  • Type-directed compilation

ASJC Scopus subject areas

  • Engineering(all)

Fingerprint Dive into the research topics of 'Compiling ML polymorphism with explicit layout bitmap'. Together they form a unique fingerprint.

Cite this