Although not technically a spec violation, stable sort was one of the oldest and most popular developer requests in our @v8js bug tracker (issue #90!): https://bugs.chromium.org/p/v8/issues/detail?id=90 …
Kudos to @nimODota for making it happen!
-
Show this thread
-
Fingers crossed
@ChakraCore eventually switches to a stable sorting algorithm, too. Then we could update the Array.prototype.sort spec to require stability and call it a day. One can dream… (@ChakraCore’s sort is currently only stable for arrays with 512 or fewer elements.)7 replies 7 retweets 71 likesShow this thread -
Replying to @mathias @ChakraCore
Curious how you see the benefits of stable sort stack up against the obscure site breaks in non-chrome, older browsers, xs, etc. as these subtle non-standard semantics become web-reality?
2 replies 0 retweets 4 likes -
Not sure what you're asking here. Right now the spec doesn't mandate anything; browser differences are totally up in the air, compat is unknown, etc. Are you trying to argue that, as more engines converge on a currently-unspecified behavior, those that don't get bit by compat?
1 reply 0 retweets 0 likes -
I should delete the entire thread. I'm not arguing, wondering what was considered re: long term interop. Maybe sort sensitivity is so rare it wont matter? Maybe browsers are replaced fast enough that it wont break too many people when sites depend on it?
1 reply 0 retweets 0 likes -
I mean, sites depending on Chrome not stable-sorting are already broken, since Firefox always stable-sorts (I think), and IE stable-sorts for reasonably-sized arrays. If anything breaks, *we* will get bug reports; you either won't, or are *already* getting them.
1 reply 0 retweets 0 likes -
I guess I'm not sure what a dependency on non-stable sort looks like.
2 replies 0 retweets 0 likes -
Replying to @bterlson @tabatkins and
More to the point, today it seems unlikely the web depends on sort stability either way. That likely changes sometime after chrome ships, tho.
1 reply 0 retweets 0 likes -
That's true. But yeah, that just means that the previously-unspecified behavior is becoming de-facto specified in a particular direction. Phase shifts should be documented!
1 reply 0 retweets 1 like -
It could be standard standard (or a discussion) before making it de facto too. Anyway, presumably the choice was made based on some data which is all I'm asking about here. But I guess... Badly. Sorry.
2 replies 0 retweets 0 likes
Background TL;DR: Array#sort was one of the last bits of self-hosted code in @v8js. Porting it was an opportunity to try something new (with http://crbug.com/v8/90 in mind). We did, and it worked out well.
Expect a @v8js blog post with more details on this project soon.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.