#95std: add an unordered map structure

  • avatar~clovercommented · 2 years ago
    Author
    Owner

    this would likely be a wrapper around js Map

    i am opening this issue to log something interesting i was told about which gave me an idea here. our map should be specification defined as un-ordered. an exerpt from an issue in go

    The Go spec says that when using range over a map, the iteration order is not specified. With our current implementation, the iteration order is always consistent for maps with 8 or fewer elements. This is not wrong, but it means that when people write tests that use small maps, they sometimes do not notice that they are depending on a consistent iteration order. That dependency fails when they run the tests with gccgo, which uses a different map implementation.

    it would be interesting if iterating a std.Map yielded randomized orderings in debug mode, to eliminate reliance on a guaranteed ordering. alternatively, this structure could be named std.UnorderedMap.


    Milestone: later.

  • avatar~clover changed the status to Todo · 2 years ago