Description
Seeing the shared memory atomics proposal and the SIMD proposal, it struck me that it will be painful if they are not orthogonal to the planned feature to allow accesses to multiple memories. I think the multiple memories feature is relatively low priority, but it seems it's worth fleshing out how it will work to avoid pain integrating it with earlier extensions.
The most general form of accessing multiple memories would require allowing values that are references to memory objects, which has a dependency on GC references.
A high !/$ form of the feature would just add a flag to memory_immediate
that indicates there's an extra field with an index into the module's memory index-space.
A way to implement the more general form of the feature without creating a dependency on it from any other extensions that add memory access operators would be to add an operator that modifies the following memory operator. However, it adds a new variety of state to the WASM virtual machine, so I'm not convinced it's the way to go.
This also applies to adding support for 64-bit addresses. Are we going to end up with (32-bit | 64-bit address) x (default memory | immediate memory index | memory operand)
versions of all the memory operators?