[Mono-list] Making a ruby.net compiler

Fergus Henderson fjh@cs.mu.OZ.AU
Mon, 12 May 2003 19:29:09 +1000


On 11-May-2003, Michal Moskal <malekith@pld-linux.org> wrote:
> 3. if you are familiar with ILX, you should remember .classunion type
>    there, that just did discriminating unions.

Right.

> But I believe it isn't very good idea to put it in Mono, since it's
> very limited (namely it seems to fit OCaml variants, but not SML
> variants (things after of can have names)

I agree that fields of discriminated union alternatives should be namable;
many languages which support discriminated unions, including Mercury,
Haskell, and Ada, allow or even require them to be named.

> 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.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.