You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Please tell me if this is not the right forum to discuss possible extensions like this.]
With this proposals (data) sections no longer “just” initialize memory, but are really things of their own, which can be addressed within the module (by index), and even change (by dropping). This leads me to the question: Should it be maybe possible to export and import (data) sections, just like one can export and import functions, globals, memories (and in the future other things)?
One vauge use case that I could see is modules (possibly even host modules) providing static data (e.g. Unicode tables, machine-learned models) to other modules.
A wrinkle that would have to be solved is what does dropping such an imported data segment mean. Should dropping only affect the “local reference”, e.g. by reference counting (less interaction between modules), or should one module dropping the segment suffice (makes it easier to merge modules).
The text was updated successfully, but these errors were encountered:
It might be useful to kick this over to the design repository for a more general discussion. @rossberg, do you have the powers to do that?
On the one hand, the alternative to importing and exporting data is to create a "data container" module that exports initialization functions for the exported data on a memory (ie I would import the "initwithUnicodeData(atLocation)" method from that module and share my memory with it).
On the other hand, the data container module would probably have to be instantiated once for each memory that wants the data it provides, and I wouldn't necessarily want to share my memory with it.
rossberg
transferred this issue from WebAssembly/bulk-memory-operations
May 26, 2020
On the other hand, the data container module would probably have to be instantiated once for each memory that wants the data it provides, and I wouldn't necessarily want to share my memory with it.
Right, that’s my thinking as well: Importing a “passive memory segment” has much stronger guarantees about what can happen than “importing an arbitrary function and giving it access to my memory”
[Please tell me if this is not the right forum to discuss possible extensions like this.]
With this proposals
(data)
sections no longer “just” initialize memory, but are really things of their own, which can be addressed within the module (by index), and even change (by dropping). This leads me to the question: Should it be maybe possible to export and import(data)
sections, just like one can export and import functions, globals, memories (and in the future other things)?One vauge use case that I could see is modules (possibly even host modules) providing static data (e.g. Unicode tables, machine-learned models) to other modules.
A wrinkle that would have to be solved is what does dropping such an imported data segment mean. Should dropping only affect the “local reference”, e.g. by reference counting (less interaction between modules), or should one module dropping the segment suffice (makes it easier to merge modules).
The text was updated successfully, but these errors were encountered: