10 ms·
This is a technique worth talking/writing about a bit more. Sometime ago, Jimmy Koppel also wrote somewhat extensively about defunctionalization and refunction
by sriku 7y ago
This is a technique worth talking/writing about a bit more.
Sometime ago, Jimmy Koppel also wrote somewhat extensively about defunctionalization and refunctionalization as "refactoring" techniques -
http://www.pathsensitive.com/2019/07/the-best-refactoring-youve-never-heard.html http://www.pathsensitive.com/2019/07/the-best-refactoring-yo...
- Smaug123 7y agoThat's a cool talk which I'd definitely recommend to people! Is there something in particular that you'd like to see "a bit more"? Are you imagining e.g. a more extended walkthrough of how to realise the benefits of defunctionalisation on a real-life program, or some more theoretical background, or some of how it's used in compilers, or anything in particular?
- sriku 7y agoMore real-life cases. The classic cases like compilers are covered enough, but I think we could use more examples in a wider range of domains. For those who use it, I think it feels like second nature and perhaps even "it's not a big deal really", but the duality is critical for building flexible systems. It's only a feeling I have at this point though. I can offer a small example to start with. Steller [1] - is a sound modeling library that's written primarily as higher order functions. It however exposes a "specFromJSON" function [2] that offers a serialization through (informal) defunctionalization. [1] https://github.com/srikumarks/steller https://github.com/srikumarks/steller [2] https://github.com/srikumarks/steller/blob/master/src/steller/scheduler.js#L1156 https://github.com/srikumarks/steller/blob/master/src/stelle...