When implementing an interpreter, is it a good or bad to piggyback off the host language's garbage collector? -
Assume that you are implementing an interpreter for a GCED language for GCed language, which looks like a GCD That you will receive garbage collection for free, as long as you are very careful about your design.
Is this usually done? Are there good reasons to do this?
There are two different things in language and sequence: they are not really related to IMHO.
Therefore, if your current runtime already provides GC, then there should be a good reason to increase the runtime with other GCs. In the good old days when the memory allocation in the OS was slow and expensive, the app brought its heap managers, where the smaller part of the data is more efficient in handling. This was a reading to add another memory management to the current runtime (or OS). But if you are talking about Java, .NET - then they should be sufficient and efficient to work most.
However, you may want to create a proper interface / API for memory and object management. Work (and others), so that your language ("guest") runtime can be applied later on to another host runtime.
Comments
Post a Comment