[Mono-list] Making a ruby.net compiler

Michal Moskal malekith@pld-linux.org
Mon, 12 May 2003 13:46:00 +0200


On Mon, May 12, 2003 at 07:29:09PM +1000, Fergus Henderson wrote:
> > or OCaml polymorphic 
> > variants (one polymorphic variant can be in several types)).
> 
> That's true, but how many other languages have OCaml-style polymorphic
> variants?
> 
> Ordinary discriminated unions are present in a very large number of
> languages, so the benefits for language interoperability of including
> them in the underlying runtime are much higher.  Also, I suspect that
> there is more scope for optimizing the representation of ordinary
> discriminated unions.

Discriminated unions if you look at them from CLI classes point of view,
are special case of types of the form Type1 | Type2 | Type3 | ... |
TypeN, where all TypeI are sealed, and maybe all have common base type. 
If CIL included types to say this kind of thing, and had instruction to
switch on them, it would be nice and leave place for optmizations, but
it would be probably harder if several or-types can share the same
TypeI.

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith : GCS {C,UL}++++$ a? !tv
: PLD Linux ::::::::: Wroclaw University, CS Dept : {E-,w}-- {b++,e}>+++ h