
13 Jan
2008
13 Jan
'08
4:17 a.m.
Luke Palmer wrote:
David Benbennick wrote:
It would be nice if I could just tell the compiler "I command you to memoize this function", and have it produce the required code automatically.
Tru dat!
But it's not clear what the best way for the compiler writer to do that is. For example, if I know the access patterns of the function, I can design the aforementioned data structure to favor those. Also, not every type admits memoization, for example functions.
Indeed. There are plenty of choices of data structures for memo "tables" and hash tables are not the best of them. Such choices are better left to the programmer. Regards, apfelmus