On Thu, Nov 22, 2018 at 3:48 AM kai zhu
wrote:
> the spread operator was a mistake.
It's neither an operator nor a mistake.
Again, please stop wasting the list's time with re-litigating decisions
that have been made.
-- T.J. Crowder
___
es-discuss
On side note, it would be beneficial to have selection in standard library.
This would cover median, min and max cases.
http://stevehanov.ca/blog/index.php?id=122
On Thu, 22 Nov 2018, 07:36 Isiah Meadows No, I'm referring to how it'd be implemented. JS implementations might
> choose to leverage
No, I'm referring to how it'd be implemented. JS implementations might
choose to leverage native vector CPU instructions in their code gen to
speed them up by a factor of 1.5-3.
-
Isiah Meadows
cont...@isiahmeadows.com
www.isiahmeadows.com
On Wed, Nov 21, 2018 at 9:51 PM Gbadebo Bello
sorry for derailing, i just have many tooling/operational gripes on es6
(and reminding of past mistakes so they're not repeated is not necessarily
bad thing).
but yea max, min, mean (and maybe sumOfSquares), are common-enough
array-tasks they would be useful as optimized (maybe also
Python and JSLint aren't in any way the arbiters of what's idiomatic in JS;
webpack is not a minifier, it's a bundler; I believe uglify-es exists, but
most people use babel and uglify, in my experience, which work fine.
Please don't derail this thread about numeric methods on array prototypes
@gbadebo, no he's talking about vectorized operations in c++ or whatever
native-language the js-engine is implemented in.
the spread operator was a mistake. it's redundant to Object.p.apply
(violates python/jslint maxim of one-way of doing things), the syntax
increases cost of maintaining
>An advantage to having this an internal primitive is you can use vector
instructions to check 4-8 values in parallel and then end with a final step
of finding the max/min value of the vector. (integers can just use bit
hacks, float max/min has hardware acceleration).
I don't quite understand,
Well, you are right. The `apply` method might not be the best(Performance
wise).
@T.J. Crowder. Wow, my mind didn't go to `reduce` at all, I don't have any
issues with it, in fact I feel it would perform better than `apply`
___
es-discuss mailing list
This reply from Gbadebo missed the list. (I confirmed in a private email.)
-
Isiah Meadows
cont...@isiahmeadows.com
www.isiahmeadows.com
On Wed, Nov 21, 2018 at 7:16 PM Gbadebo Bello wrote:
>
> Yh, i felt the same way about the rest also but thought it would be nice to
> atleast get
Yh, i felt the same way about the rest also but thought it would be nice to
atleast get feedback b concluding.
-- Forwarded message -
From: Gbadebo Bello
Date: Mon, Nov 19, 2018, 01:27
Subject: Re: Numeric Array prototypes (Isiah Meadows)
To: Isiah Meadows
Yh, i felt the same
An advantage to having this an internal primitive is you can use vector
instructions to check 4-8 values in parallel and then end with a final step
of finding the max/min value of the vector. (integers can just use bit
hacks, float max/min has hardware acceleration).
The arithmetic mean could be
On Wed, Nov 21, 2018 at 7:23 AM Isiah Meadows
wrote:
>
> It doesn't work as well with larger collections.
For example, fails at somewhere between an array of length 125,000 and
126,000 on V8 in Chrome v70 (as does the `apply` trick, so the proposed
polyfill would have the same problem):
It doesn't work as well with larger collections.
Personally, it makes most sense in a standard library module
On Wed, Nov 21, 2018 at 00:43 Michael Luder-Rosefield <
rosyatran...@gmail.com> wrote:
> > Math.min() method doesn't work on Arrays right out of the box.
>
> No, but rest parameters
> Math.min() method doesn't work on Arrays right out of the box.
No, but rest parameters work: Math.min(...arr) is fine, and works with Sets
too.
On Wed, 21 Nov 2018 at 14:08 Isiah Meadows wrote:
> Not sure these belong in the standard library itself. I could see max and
> min being there
Not sure these belong in the standard library itself. I could see max and
min being there (these are very broadly useful), but the others, not so
much. I'd also like both max and min accept an optional comparison callback
of `(a, b) => a < b`. But the rest seem too narrowly useful IMHO.
On Tue,
The array object has no method for finding the minimum value of an array of
numbers and the Math.min() method doesn't work on Arrays right out of the
box. I'll have similar issues if i wanted to return the maximum number, the
mean, mode, median or standard deviations in any array of numbers.
16 matches
Mail list logo