Computer Science and Information Systems 2014 Volume 11, Issue 4, Pages: 1417-1434
https://doi.org/10.2298/CSIS130923030F
Full text ( 262 KB)
Cited by


Modular polymorphic defunctionalization

Fourtounis Georgios, Papaspyrou Nikolaos S., Theofilopoulos Panagiotis

Defunctionalization is generally considered a whole-program transformation and thus incompatible with separate compilation. In this paper, we formalize a modular variant of defunctionalization which can support separate compilation for a functional programming language with parametric polymorphism. Our technique allows modules in a Haskell-like language to be separately defunctionalized and compiled, then linked together to generate an executable program. We provide a prototype implementation of our modular defunctionalization technique and we discuss the experiences of its application in compiling a large subset of Haskell to low-level C code, based on the intensional transformation.

Keywords: defunctionalization, separate compilation, polymorphism, Haskell