What is a reasonable expectation for an API which models (and can read and write) a WASM program, in terms of reproducibility? Is it reasonable to expect that the model might reorder components such as elements or data segments or types between read and write? If not, is it better to preserve the original order or to establish some other predictable order (for example, sorting criteria) to ensure that a given input gives an output that is at least repeatable?
or, should the model (or compiler) have complete flexibility to emit stuff in any random order?
I think that's an interesting question! I don't personally have a good answer for most cases but I want to mention that the order of custom sections can sometimes matter. For example, https://github.com/WebAssembly/tool-conventions/blob/main/DynamicLinking.md defines a "dylink.0" custom section and says "This section is expected to be the very first section in the module."
that makes sense
Last updated: Nov 22 2024 at 16:03 UTC