Defunctionalization - ku-fpg/blackboard GitHub Wiki
Neil
What's the key distinction [between defunctionalisation and closure conversion]
Greg Morrisett
Defunctionalization converts to a first order form, but requires turning all closures into (say) a number paired with an environment, and implements a "call" by doing a switch/case on the number. Closure conversion uses a pointer to a closed function (I.e., a C function pointer) instead of a tag. At the machine level, defunctionalization requires no "jumps through a register". But, you need to know how many lambdas are in the whole program (to assign them a unique number) so it requires global information. Closure conversion does not and hence supports separate compilation.