Is it possible for BitC on CLI to satisfy the representation requirements for unions? I don&#39;t believe so, and this strikes me as an area where CLI can/should be improved.<br><br><div class="gmail_quote">On Sat, Nov 15, 2008 at 12:31 AM, Eric Northup <span dir="ltr">&lt;<a href="mailto:digitale@digitaleric.net">digitale@digitaleric.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Rodrigo Kumpera wrote:<br>
&gt; The naive approach to support generics by a CLR VM is to expand every<br>
&gt; instantiation and produce<br>
&gt; native code for all variations. This is far from optimal as the<br>
&gt; generated bloat usually interacts pretty bad<br>
&gt; with the icache.<br>
&gt;<br>
&gt; What the VMs support [1] is sharing code for all reference types,<br>
&gt; which expands to pretty much the same thing.<br>
&gt; For valuetypes this sharing is non-trivial so no VM does it.<br>
The very first CLR VM to support generics actually did share code for<br>
compatible (from the perspective of the GC&#39;s reference visitor)<br>
structure types - see section 4.1 of<br>
<a href="http://research.microsoft.com/projects/clrgen/generics.pdf" target="_blank">http://research.microsoft.com/projects/clrgen/generics.pdf</a> .<br>
<br>
[...]<br>
&gt; BTW, I think BitC would map very well on top of the CLR given it had<br>
&gt; interface injection support.<br>
I agree that a CLI target would be interesting for BitC. &nbsp;No particular<br>
support for interface injection is necessary - I can imagine several<br>
direct embeddings of type classes into CLI interfaces. &nbsp;Polyinstantation<br>
or method dictionaries could also be done while targeting the CLI, thus<br>
treating it as a lower-level IL. &nbsp;The lower-level IL might potentially<br>
be compatible with the CIL subset supported by the gcc cli front-end.<br>
<br>
<br>
I didn&#39;t quite understand what Shap said about sometimes needing to<br>
dynamically fabricate a dictionary, though. &nbsp;Is that a consequence of<br>
separate compilation?<br>
_______________________________________________<br>
bitc-dev mailing list<br>
<a href="mailto:bitc-dev@coyotos.org">bitc-dev@coyotos.org</a><br>
<a href="http://www.coyotos.org/mailman/listinfo/bitc-dev" target="_blank">http://www.coyotos.org/mailman/listinfo/bitc-dev</a><br>
<br>
</blockquote></div><br>