Our analysis of function calls from Abstract Wikipedia indicates that function execution may be made more efficient by memoizing intermediate calls in the composition language. In order to make this feasible, the composition language needs some initial cleanup and new features.
- The realize() family of operations must be well-defined for all WFObject types.
- The caching of realization status (and cache invalidation of same) must likewise be well-defined.
- Function arguments should no longer contain references to the stack state; closures should be modeled explicitly, and all function arguments/return values should refer to the most proximal function call's stack state when necessary.
- Memoization cache keys should be generated in a way that is cacheable and composable:
- an object's cache key should be generated only once for a given realization state and stored on the object;
- if a sub-object's cache key has been stored, containing object's can reuse it when generating the cache key;
- if a sub-object's realization state changes, the containing object's stored cache key (if any) should be changed or at least poisoned.