Deterministic Proposal

Isiah Meadows isiahmeadows at
Wed Jun 21 15:34:14 UTC 2017

I'd like to note that even Haskell compilers (which can check for this
trivially) never memoize implicitly. They only memoize infinite data

As for this proposal, I see exactly zero benefit whatsoever. Engines
already cover the relevant optimization opportunity without this
(through type ICs), and it's often faster in practice to recalculate
than memoize based on argument.

The only time I have found memoization to be very useful is in one
specific case: lazy evaluation (run once). But that is constrained to
just evaluating a thunk and storing the result.

Isiah Meadows
me at

Looking for web consulting? Or a new website?
Send me an email and we can get started.

On Wed, Jun 21, 2017 at 6:01 AM, Jussi Kalliokoski
<jussi.kalliokoski at> wrote:
>> deterministic function sum(a, b) { return a + b; }
> Ironically, having the engine decide when to memoize would make the
> "deterministic" functions non-deterministic:
> deterministic function foo(a, b) { return { a, b }; }
> foo(1, 2) === foo(1, 2) // may or may not be true
> _______________________________________________
> es-discuss mailing list
> es-discuss at

More information about the es-discuss mailing list