On Thu, Mar 18, 2010 at 7:55 PM, Sandro Magi <[email protected]> wrote:

>  > The CLI type system is not expressible enough to support tag-less safe
> > unions.
> > Mostly because it's undecidable which element is been used without
> > either tags
> > or explicit checks.
>
> I don't think the idea is tag-less unions, but tagged unions. Tagless
> unions are one step beyond, but I can see how they could be useful. A
> phantom type as a type tag would work, assuming the compiler was aware
> of its meaning.
>
>
Adding GC support for tagged unions on mono is not hard. With Boehm, just
make
those types have no GC descriptor all all their words will be conservatively
scanned.
For the new GC, it's a matter of producing a new kind of GC descriptor that
tell it where
and how to interpret tags.

The JIT would have to be changed as well so stores to tagged unions cause
the tag to be
stored as well. How to proper generate loads is a good question thou. I
wouldn't mind doing
the Mono side of the task, btw.

Let's keep in mind that this work would need to be done with LLVM as well.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to