You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Andy Gill edited this page Oct 15, 2015
·
1 revision
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.