TY - GEN
T1 - Compiling ML polymorphism with explicit layout bitmap
AU - Nguyen, Huu Duc
AU - Ohori, Atsushi
PY - 2006
Y1 - 2006
N2 - 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.
AB - 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.
KW - Garbage collection
KW - Memory management
KW - Polymorphism
KW - Type-directed compilation
UR - http://www.scopus.com/inward/record.url?scp=33750902813&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=33750902813&partnerID=8YFLogxK
U2 - 10.1145/1140335.1140364
DO - 10.1145/1140335.1140364
M3 - Conference contribution
AN - SCOPUS:33750902813
SN - 1595933883
SN - 9781595933881
T3 - PPDP'06 - Proceedings of the Eight ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming
SP - 237
EP - 248
BT - PPDP'06 - Proceedings of the Eight ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming
PB - Association for Computing Machinery
T2 - PPDP'06 - 8th ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming
Y2 - 10 July 2006 through 12 July 2006
ER -