Deterministic Proposal
Isiah Meadows
isiahmeadows at gmail.com
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
structures.
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 isiahmeadows.com
Looking for web consulting? Or a new website?
Send me an email and we can get started.
www.isiahmeadows.com
On Wed, Jun 21, 2017 at 6:01 AM, Jussi Kalliokoski
<jussi.kalliokoski at gmail.com> 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 mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
More information about the es-discuss
mailing list