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 numerically-stable) built-in methods. On Thu, Nov 22, 2018, 12:12 Jordan Harband <[email protected]> wrote: > 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 > with complaints about the spread operator, thanks. > > On Wed, Nov 21, 2018 at 9:48 PM kai zhu <[email protected]> wrote: > >> @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 minifiers (for those who dislike webpack's >> monopoly, and prefer zero-config, zero-dependency alternatives like >> [classic] uglifyjs), and has performance footguns like the one mentioned by >> @tj. >> >> On Thu, Nov 22, 2018, 10:51 Gbadebo Bello <[email protected]> >> wrote: >> >>> >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, does javascript now support vectorised >>> operations on the client side or an external library would be needed for >>> this? >>> >>> On Thu, Nov 22, 2018, 03:26 Gbadebo Bello <[email protected]> >>> wrote: >>> >>>> 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 >>> [email protected] >>> https://mail.mozilla.org/listinfo/es-discuss >>> >> _______________________________________________ >> es-discuss mailing list >> [email protected] >> https://mail.mozilla.org/listinfo/es-discuss >> >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

