docs and examples
Can you document the differences between the types Rooted and Handle?
They seem to be very similar. Maybe, also some examples of the 2 different usecases they satisfy.
I have a stack VM and when i allocate a new object, i do insert on the heap and it gives back a Rooted<T>.
But on the example, you are using Handle in the Object enum. Should i do rooted.into_handle()?
It is unclear.
It looks like, the Handle will not keep the object alive.
Yes, you're correct. Rooted will survive a heap clean (and acts as the 'root' of an object tree) whereas Handle will not. If you have a stack VM, items on your stack should probably be Rooted<Value>s, but references within your Value should be Handle<Value>s.
Yes, you're correct.
Rootedwill survive a heap clean (and acts as the 'root' of an object tree) whereasHandlewill not. If you have a stack VM, items on your stack should probably beRooted<Value>s, but references within yourValueshould beHandle<Value>s.
Right. Rooted is like Rc<T> and Handle is like Weak<T>