On Fri, Nov 14, 2008 at 8:52 AM, Rodrigo Kumpera <[EMAIL PROTECTED]> wrote:
> The naive approach to support generics by a CLR VM is to expand every > instantiation and produce > native code for all variations.... Yes. We're aware of that issue and several others. The goal, for the moment, is simply to get a complete implementation of the language finished. The optimization you mention, and several others, will follow. Naive is better than nothing. :-) What the VMs support [1] is sharing code for all reference types, which > expands to pretty much the same thing. > For valuetypes this sharing is non-trivial so no VM does it. For us that will be important in lieu of inheritance, but we see how to do it straightforwardly, and we even see how to do it in a type-safe way. The problem I anticipate is that our strategy for type class instantiation probably needs to be revised for a non-kernel implementation into something closer to a v-table style of implementation. >From my narrow understanding of typeclasses, they can be seen as interfaces > that don't need to be explicitly > implemented by the target types. So the problem of sharing code for > typeclasses is then pretty much the same > as for sharing for generics types with bounds (restrictions on the type > arguments) [2]. Not quite, because of size-based polymorphism, but yes, that's the general idea. > The main issue we had within mono was carrying runtime information around > to make introspection works. I > don't know how much introspection/reflection support BitC has, but it would > be nice if you could explain how > do you plan on tackle on these issues. Read-only introspection isn't much of a problem. Read-write introspection is such a disaster from an assurance perspective that we have very explicitly excluded it. BTW, I think BitC would map very well on top of the CLR given it had > interface injection support. Actually, BitC cannot run on either CLR or JVM, because there are representation requirements that neither platform can meet. If those requirements are set aside, then yes, I think it would work fine on either platform.
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
