On Thu, Mar 5, 2009 at 12:56 PM, Rodrigo Kumpera <[email protected]> wrote: > I'm, for one, am thinking about using BitC to write virtual machines.
If you mean "virtual machine" in the sense of Xen, then all allocations should be occurring once at startup time and never thereafter. In consequence you will never GC and the presence or absence of GC is moot. If you mean "virtual machine" in the sense of a JVM, you will find in practice that a sensibly written virtual machine observes the above-stated rule. While it does allocate in certain situations, every allocation after startup will end up in the application heap. At most, you will end up in a situation where you are managing a small number of very large blocks. > On this case, using just a GC is pretty complex, as it would require a > meta-circular design... I'm not clear why you think this should be true. Can you explain? GC at the level of the VM should be completely separated from GC at the level of the bytecode application. > At the same time, there is no reason for a GC written in BitC to require the > use of big chunks > of unsafe code just because it has to deal with low level memory management > - as, obviously, > it can't use another GC for this job. Correct. And I can see no reason why GC cannot be written in BitC today. The part where I think you are getting hung up lies in assuming that the design must be metacircular. I agree that is hard. > There are some issues with been GC only for memory allocation. Generating > code that is good for precise GC is tricky, either you make a performance > compromise or you > generate huge stack maps; > object placement is another issue, as some objects used by the GC itself > can't be moved. What objects are used by the GC itself? That shouldn't happen. Is this the metacircular problem again? > On the > end of the day, a VM will have to replace the BitC runtime provided > collector with one that bends well > with the target runtime. It will almost certainly have to replace the GC subsystem, but not to mesh it with the target runtime. I do not assume that there will ever exist a "one size fits all" implementation of GC, and I DO assume that applications which take on the characteristics of runtime systems will tend to need specialized GC systems. shap _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
