2 ms·
> I think templated or generic handle classes are pretty good for dealing with foreign objects. They can handle any bookkeeping a VM requires. What do you mean
by lmm 9y ago
> I think templated or generic handle classes are pretty good for dealing with foreign objects. They can handle any bookkeeping a VM requires.
What do you mean by this?
- sjmulder 9y agoWith C++' destructor call guarantee and its templating features, it's feasible to implement shared_ptr-like types for foreign object types. Microsoft's ComPtr for example takes care of COM referencing counting. If some VM would require you to pin and unpin objects before and after use, you can do that in such a handle.
- lmm 9y agoHmm, you're talking about calling into a VM language from a manual-ownership language like C++? At that point any VM language would be fine, but I'm not sure that scenario makes sense in the first place - if the outer program is in C++ that's presumably because it has some requirement avoid GC, and embedding a VM that has to do GC would undermine that.