Modular Polymorphic Defunctionalization
- School of Electrical and Computer Engineering, Software Engineering Laboratory
National Technical University of Athens
{gfour, nickie, ptheof}@softlab.ntua.gr
Abstract
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.
Key words
defunctionalization, separate compilation, polymorphism, Haskell
Digital Object Identifier (DOI)
https://doi.org/10.2298/CSIS130923030F
Publication information
Volume 11, Issue 4 (October 2014)
Special Issue on Advances in Systems, Modeling, Languages and Agents
Year of Publication: 2014
ISSN: 2406-1018 (Online)
Publisher: ComSIS Consortium
Full text
Available in PDF
Portable Document Format
How to cite
Fourtounis, G., Papaspyrou, N. S., Theofilopoulos, P.: Modular Polymorphic Defunctionalization. Computer Science and Information Systems, Vol. 11, No. 4, 1417–1434. (2014), https://doi.org/10.2298/CSIS130923030F