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
There's one thing that confuses me and needs to be clarified for the patch: Even after removing both get and Protocol::INDEX_GET instance functions from Vec's native module declaration I can still do let item = v[1] in the Rune script, which is completely unexpected.
Ok I understand. Intuitively I would think that neither the integer nor the range indexing should be an internal Vm operation because if there are instance functions in the native modules (like get()) which are just another frontend to the indexing you have to implement the operations twice.
Hm, Vm operation exists because it accelerates the operation. We avoid additional dispatch to the external function which involves a bit of stack mangling.
I'd be open to being able to disable internal acceleration maybe it could be done through a feature flag, but then you'd run the risk of feature parity. All though disabling it completely should probably be supported at some point for folks that really wants a completely bare virtual machine.
Vec indexing is inconsistent. For example, indexing a single item in a vector works fine:
Obtaining slices into the vector fails, however:
For String types, on the other hand, this works as expected. I have a patch for Rune ready that I can contribute.
The text was updated successfully, but these errors were encountered: