Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: subtyping and inheritance
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Didier Remy <remy@m...>
Subject: Re: subtyping and inheritance
Dear Beppe,

> Surely, it would require some modifications to the compiler, but all it
> would have to do is to mark some particular methods and all the objects
> that could call these methods by a natural number (for those who know,
> some sort of De Brujin notation, that a purist may consider as dynamic
> type information). How to do it in practice is described for the language
> O2 in [1] (but without the natural numbers since in O2 the dynamic type
> information is available). This is obtained by simply modifying the
> compiler without affecting the language.  

> ...

The works [1] and [2] that you cite apply to the languages O2 and Java.
However, both languages have a very weak type system. In particular, neither
one supports polymorphic types (hence parametric classes) or self types.
Thus, I don't think that your experiences with O2 and Java can immediately
be transfered to Ocaml.  In particular, adding dynamics types in the
presence of polymorphism is much more complex than the simple sketch above.
Also, regarding type checking, you probably need the higher-order version of
lambda-&, which is much more difficult than the first-order version that you
are using in [1] and [2]. Of course, type inference is likely to be another
complication... 

So I do not think that applying [1] or [2] to Ocaml is an implementation
exercise. It certainly remains an interesting, but serious and probably
difficult, research project.

        -Didier