4 ms·
Could you clarify this, and give an example? This is an intriguing idea of eval that gets limited kinds of expressions, whether from defunctionalization or for
by whitten 5y ago
Could you clarify this, and give an example?
This is an intriguing idea of eval that gets limited kinds of expressions, whether from defunctionalization or for security reasons.
- matheusmoreira 5y agoInstead of having a function that can accept an arbitrary function as parameter, the compiler enumerates all known uses of the function into a data type and uses that as input instead. The resulting code is no longer general purpose. It's as if you gave Intel your program and they produced a special optimized processor that runs just the instructions found in your program and nothing else. > the insight of defunctionalization is to find all actual uses of the higher-order function > Each distinct use of the filter function yields a new case in the Filter datatype