[m-rev.] Re: [m-dev.] for discussion: pragma foreign_import

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Dec 6 16:15:41 AEDT 2001


On 05-Dec-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> On Wed, Dec 05, 2001 at 05:57:07PM +1100, Fergus Henderson wrote:
> > > Index: reference_manual.texi
> > > ===================================================================
> > > RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
> > > retrieving revision 1.229
> > > diff -u -r1.229 reference_manual.texi
> > > --- reference_manual.texi	4 Dec 2001 11:11:59 -0000	1.229
> > > +++ reference_manual.texi	4 Dec 2001 13:43:47 -0000
> > > @@ -5009,7 +5009,10 @@
> > >  @node Data passing conventions
> > >  @section Data passing conventions
> > >  
> > > -Each backend will have its own conventions for passing data.
> > > +For each backend,
> > > +we explain how to map a Mercury type to a type on the backend.
> > > +We also map the Mercury parameter passing convention
> > > +to the backend parameter passing convention.
> > 
> > s/backend/back-end/g
> > 
> > Also the conventions should be language-specific,
> > not back-end specific.
>
> I am not so sure about this.

I am.

> Why should the Managed C++ convention be different to the C convention?
> MC++ is just a superset of C.  It is different because we do different
> things on the different backends.

It is different due to histerical reasons.  If we were to redo the C
interface again, it might look more like the Managed C++ interface.
The reason we do different things with Managed C++ than we do for
C is mainly because we weren't hampered by backwards compatibility
issues when designing the Managed C++ interface.

Suppose we implement a C interface for the .NET back-end.
Should it use the same conventions as the MC++ interface for the .NET back-end,
or the same conventions as the C interface for other back-ends?
The answer has to be the latter, because that is the only answer
which will ensure portability of code which uses the C interface
across different back-ends.  Therefore things should be language-specific,
not back-end specific.

-- 
Fergus Henderson <fjh at 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.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list