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. 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 a compiler from a large subset of Haskell to low-level C code, based on the intensional transformation.
Bibtex: Fourtounis and Papaspyrou (2013)
Georgios Fourtounis and Nikolaos S Papaspyrou. Supporting separate compilation in a defunctionalizing compiler. In OASIcs-OpenAccess Series in Informatics, volume 29. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2013. ↩