[Haskell-cafe] memoization

wren ng thornton wren at freegeek.org
Wed Jul 24 05:39:34 CEST 2013


On 7/22/13 7:41 PM, David Thomas wrote:
> On Mon, Jul 22, 2013 at 4:04 PM, wren ng thornton <wren at freegeek.org>
wrote:
>> In principle, we could translate between these two forms (the f2 ==> f1
>> direction requires detecting that y does not depend on x). However, in
>> practice, the compiler has no way to decide which one is better since it
>> involves a space/time tradeoff which: (a) requires the language to keep
>> track of space and time costs, (b) would require whole-program analysis to
>> determine the total space/time costs, and (c) requires the user's
>> objective function to know how to weight the tradeoff ratio.
>
> I, for one, would love to have a compiler do (a) based on (b), my
> specification of (c), and the ability to pin particular things...

Oh, so would I! But, having worked on this problem in a different
language, I'm well aware of how difficult it is to actually implement (a)
and (b).

-- 
Live well,
~wren





More information about the Haskell-Cafe mailing list