Re: Feature proposal

2018-07-19 Thread Nicolas B. Pierron
On Thu, Jul 19, 2018 at 12:53 PM, Nicolas B. Pierron wrote: >> On Wed, Jul 18, 2018 at 2:06 PM Nicolas B. Pierron >> wrote: >>> Stupid question, but why are some of these methods implemented on >>> String, Array, TypedArray, Map and Set, while all of them are >

Re: Feature proposal

2018-07-19 Thread Nicolas B. Pierron
On Wed, Jul 18, 2018 at 6:43 PM, Mike Samuel wrote: > On Wed, Jul 18, 2018 at 2:06 PM Nicolas B. Pierron > wrote: >> Stupid question, but why are some of these methods implemented on >> String, Array, TypedArray, Map and Set, while all of them are >> Iteratable? > &

Re: Feature proposal

2018-07-18 Thread Nicolas B. Pierron
`reverse` generator property on Iteratable. Iteratable.prototype.reverse = function* reverse() { … }; foo.reverse().forEach( e => console.log(e) ) Though, this implies that all these objects implement the Iteratable prototype, and I am not sure what impact this m

Re: Math.sincos(x)?

2017-06-23 Thread Nicolas B. Pierron
f you get a subsequent call with the same theta, you've > already done half the work. As far as I know the spec does not provide any mean to specify an acceptable precision to math operations so having an interval-reduced equivalent would not be compliant wit

Re: Math.sincos(x)?

2017-06-23 Thread Nicolas B. Pierron
garbage collector. This will also add memory writes/reads to/from memory. Both are not desirable when you are doing math-intensive operations. -- Nicolas B. Pierron ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: "Super" hoisting

2016-05-13 Thread Nicolas B. Pierron
On Fri, May 13, 2016 at 4:19 PM, Herby Vojčík wrote: > > > Nicolas B. Pierron wrote: >> >> I do not understand how having local variable should change any GC >> pattern unless you are creating them in the for-loop body. > > > If I understand correctly, the p

Re: "Super" hoisting

2016-05-13 Thread Nicolas B. Pierron
called at 60fps in an animation loop (which is the case). Scope wise, yes, but a different init value would be used every time. var o = {}; for (var i = 0; i < 100; i++) { … } is different than for (var i = 0; i < 100; i++) { var o = {}; … } -- Nicolas B. Pierron ___

Re: "Super" hoisting

2016-05-13 Thread Nicolas B. Pierron
t;>> >>>>> On May 12, 2016, at 1:33 PM, Allen Wirfs-Brock >>>>> wrote: >>>>> >>>>> >>>>>> On May 12, 2016, at 9:39 AM, Brian Barnes wrote: >>>>>> >>>>>> ... >>>>>> If I call doSomething a lot of times, I get a lot of objects to be >>>>>> tracked and GC’d. Yes, I can rewrite that code to obviously eliminate >>>>>> them, >>>>>> but pretend there is actually something interesting happening here that >>>>>> requires those variables. And engines can be smart enough to mark them >>>>>> and >>>>>> deal with them with the function ends (I don’t know if this is done.) >>>>>> >>>>>> What I’m thinking is some kind of class based hint that would “super” >>>>>> hoist all local function variables. It would be sugar but it would >>>>>> transform it into: >>>>>> >>>>> >>>>> >>>>> Local variables like a,b,c in your example are probably the least >>>>> expensive construct in JS. In your example, there are no objects created >>>>> by >>>>> doSomething, not state that persists after doSomething returns, and no GC >>>>> pressure. Anything you do WRT moving such local state into object >>>>> properties >>>>> is going to be more expensive. >>>>> >>>>> Allen >>>>> >>>> ___ >>>> es-discuss mailing list >>>> es-discuss@mozilla.org >>>> https://mail.mozilla.org/listinfo/es-discuss >> >> >> ___ >> es-discuss mailing list >> es-discuss@mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss > > ___ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss -- Nicolas B. Pierron ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: GC/Compile requests, with 3D engine demonstration

2016-03-14 Thread Nicolas B. Pierron
the amount of memory which can be reclaimed. Thus deciding or not to compact the heap. I also think that this could be used as an assertion for developers, in which case the engine can later warn the developer that objects which were supposed to be unused are still alive when the GC is execute

Re: How should operator overloading work?

2015-12-30 Thread Nicolas B. Pierron
em as symbols. > > I always saw overloading operators with Symbols, but you could just > have reserved member names on the prototype of the object as well ~ > '++operator' similar to C++ ? > ___ > es-discuss mailing list > es-di

Re: Re[2]: Operators overriding

2015-12-28 Thread Nicolas B. Pierron
; es-discuss@mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> >> >> >> ___ >> es-discuss mailing list >> es-discuss@mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> > > > ___ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > -- Nicolas B. Pierron ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss