Re: Unordered setsmaps, for when ordering is hard/expensive/unwanted?

On Mon, Sep 2, 2013 at 12:25 PM, Brendan Eich <brendan@secure.meer.net> wrote:
> No, but thanks for your patience going through why it's hard to require a
> canonical order. We'll have to do one or both of:
>
> * Leave things unspecified.
>
> * Add the random starting index _a la_ Go, as Tab suggests.
>
> In either case, we would hope that the problem Bjoern cites doesn't come to
> pass (that one implementation's order becomes a de-facto standard). Without
> evidence I have a hard time believing either bullet-point affects the
> likelihood of that problem arising.

Well, we know from experience that the first one is a no-go - we
always end up with compat pain, sometimes getting bad enough to force
a de facto order to become a de jure one.

The second one at least has a chance - in a lot of cases, authors
depending on a particular order will be broken fast.  (In particular,
anyone depending on things being at a particular index will be broken
immediately.  Anyone depending on things near each other remaining
near will be broken an amount of time relative to the distance between
them and the size of the rest of the set.)  Since an author can't work
around the breakage except by removing their order-dependence (or
explicitly handling it by shifting the values into a Set/Map of their
own, manually).

And as an added bonus, if you've removed your order dependency, then
if we *do* end up with the whole thing being wasted effort, us
removing the random start won't hurt you either.  ^_^  (Of course, you
may have come to depend on the random start for some reason. C'est la
vie.)

~TJ

Received on Monday, 2 September 2013 19:45:23 UTC