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
Currently, during the transformation, function calls and reading a parameter return an owned value of the primitive. This isn't the best as it means that every time a function is called or a parameter is read, there will be a clone. I'm not sure what a good way to solve this would be, but I'm pretty much thinking a sort of heap type could be added to the transformer context, and variables will then have a reference to an Rc or something similar, then adding another primitive (Primitive::Ref) that will be a reference to an owned primitive, or something to derive the reference (like an id) (the owned value will be in this heap type)
The text was updated successfully, but these errors were encountered:
this would also introduce issues like "when to delete that reference", at that point we could introduce a lifetime model like a RAII, so when the current context frame is popped, the constants that were declared in it will be dropped, and the references to previous owned primitives will still be available as they are in other frames. In general, as the language was designed, it wouldn't be possible for a parent frame to hold references created in child frames, so this approach should work
Currently, during the transformation, function calls and reading a parameter return an owned value of the primitive. This isn't the best as it means that every time a function is called or a parameter is read, there will be a clone. I'm not sure what a good way to solve this would be, but I'm pretty much thinking a sort of heap type could be added to the transformer context, and variables will then have a reference to an Rc or something similar, then adding another primitive (Primitive::Ref) that will be a reference to an owned primitive, or something to derive the reference (like an id) (the owned value will be in this heap type)
The text was updated successfully, but these errors were encountered: