[m-dev.] For review: Mercury meeting minutes for 9/2/2001

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Feb 10 14:53:02 AEDT 2001


On 09-Feb-2001, Peter Ross <peter.ross at miscrit.be> wrote:
...
> > > +		- Working on abstract equivalence types for Java backend
> > 
> > s/for Java backend/for .NET and Java back-ends/
> > 
> > .NET was the original motiviation, although this will be needed
> > for Java too.
>
> Didn't rejj have a change which did this?

rejj had a change to delay expansion of abstract equivalence types.
His change was never completed, and has not been committed into the
repository.

Delaying expansion of abstract equivalence types is part of one way of
solving the problem for .NET / Java.  The other part is changing the
way that we generate code so that all abstract types are mapped to
`Object' (in case they are implemented as abstract equivalence types).
Any procedure which takes abstract types as parameters will need to
cast them from `Object' to the right type before using them.
Likewise, abstract types used as fields in concrete types will need to
be stored as `Object'.

This solution is the one that would be most faithful to the Mercury
compilation model.  However, implementing this solution (finishing
off rejj's changes, and changing code generation for abstract types)
would be a lot of work.  And the resulting code that we'd generate
with this solution would have a lot of boxing, unboxing, and dynamic
type casts.  It's also distributed fat; code which does not use
abstract equivalence types but does use abstract types will end
up paying an efficiency cost.

An alternative solution is to expand abstract equivalence types at
compile time.  This breaks the versioning properties of the Mercury
compilation system, because any change to the definition of an
abstract equivalence type will require recompiling all modules that
use that type.  However, this approach is probably a fair bit less
work to implement, will lead to substantially more efficient code,
and is probably better for interoperability.  So that is the one
that I am working on implementing.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list