-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamically initializing a non mutable array #515
Comments
There are several instructions: We did not add That said, keep in mind that the only reason why we have immutable arrays in the first place is richer Wasm-level subtyping. In cases where you don't need subtyping on the array field type – such as in the representation of strings – there is no particular reason to use immutable arrays. In particular, immutability is pointless when the field type isn't a reference. |
Thanks for confirming. |
I'm afraid that is a misunderstanding of Wasm's intended role. Wasm is a low-level language abstracting hardware, a virtual CPU, and as such not meant to reflect source-level concepts. In particular, the GC extension is not intended to give producers any more protection than they get with linear memory, the only inherent protection is for the engine itself. Any source-level protection mechanisms must be ensured at a higher level, as with a physical CPU. |
Thanks for the clarification 👍 |
Hi,
I'm probably missing the obvious but I can't seem to find a way to dynamically populate a non mutable array:
There are many scenarios where a non-mutable array needs to be dynamically populated rather than sourced from static data. Some examples:
What am I missing ?
The text was updated successfully, but these errors were encountered: