PLClub Discussion Group
Defunctionalization
Apr 24 2020Li-yao Xia
We will discuss defunctionalization, a programming technique which is amazingly simple and powerful. I will talk about its origins (a paper by John Reynolds in 1972 [1], and also the precursor idea of closures, in a paper by Peter Landin in 1964 [2]), and then present some applications, possibly with a more PL bent than the homework below.
Homework:
(Long-ish) A practical introduction to defunctionalization is the following talk, which comes with a transcript, and is a lot of fun even if you’re already familiar with the topic:
“The Best Refactoring You’ve Never Heard Of” by James Koppel (2019)
http://www.pathsensitive.com/2019/07/the-best-refactoring-youve-never-heard.html
(Short) A condensed version appeared as a post on the SIGPLAN blog:
“Defunctionalization: Everybody Does It, Nobody Talks About It” by James Koppel (2019)
https://blog.sigplan.org/2019/12/30/defunctionalization-everybody-does-it-nobody-talks-about-it/
(Optional) If you have more time, this paper has a great collection of detailed examples:
"Defunctionalization At Work" by Olivier Danvy and Lasse Nielsen (2001)
https://dl.acm.org/doi/10.1145/773184.773202