Currently, mojom has only one map type, and different languages make different decisions about how those maps are implemented. This is confusing and means that types need to satisfy different conditions depending on the languages they compile to.
I propose replacing the map type with two new types that specify how their contents are stored. and converting some existing maps:
- All maps that compile to blink will become `hash_map`s, since that's what blink uses.
- Maps which are used for lookup, but not iteration, will also become `hash_map`s.
- The remaining maps will be `ordered_map`s (the C++ default).
Step (2) is technically optional, and will likely be performed by an AI automation to evaluate each instance of maps.
I wrote up
a brief description of this proposal in a separate document to make it easy to gather feedback; feel free to make suggestions, and I will proceed with this work in the future unless there are major objections.
--Devon Loehr