Lazy evaluation

Matthew Robb matthewwrobb at gmail.com
Mon Sep 11 12:36:24 UTC 2017


> I think it's irrelevant if internally VMs are not too happy. VMs are
there to solve our problems, not vice-versa ;-)
​
This ^​ is very important for everyone to get on board with. Regardless the
cost should be negligible as the shape is only changing at the point of
delayed init. This will cause, for example V8, to deop the object and have
to build a new hidden class but only the one time. I guess it would
potentially be interesting to support an own property that when undefined
would delegate up the proto chain.


- Matthew Robb

On Mon, Sep 11, 2017 at 7:09 AM, Andrea Giammarchi <
andrea.giammarchi at gmail.com> wrote:

> Hi Peter.
>
> Unless you have a faster way to do lazy property assignment, I think it's
> irrelevant if internally VMs are not too happy. VMs are there to solve our
> problems, not vice-versa ;-)
>
> Regards
>
>
>
> On Mon, Sep 11, 2017 at 11:54 AM, peter miller <fuchsia.groan at virgin.net>
> wrote:
>
>> Hi Andrea,
>>
>> ```
>>> class CaseLazy {
>>>   get bar() {
>>>     var value = Math.random();
>>>     Object.defineProperty(this, 'bar', {value});
>>>     return value;
>>>   }
>>> }
>>> ```
>>>
>>
>> Doesn't this count as redefining the shape of the object? Or are the
>> compilers fine with it?
>>
>> Peter
>> --
>> "There were drawings, and sheets of paper with writing on them, and it
>> seemed that they were the sustenance of life, that here were the warlocks,
>> almost the vehicles of destruction of man's life, but at the same time the
>> very reason for his living." --- Maeve Gilmore/Titus Awakes.
>>
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170911/6c2c8447/attachment.html>


More information about the es-discuss mailing list