[m-rev.] for review: update docs for foreign language interface

Peter Ross pro at missioncriticalit.com
Fri Nov 1 00:53:15 AEDT 2002


On Fri, Nov 01, 2002 at 12:19:28AM +1100, Fergus Henderson wrote:
> On 31-Oct-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> > On Thu, Oct 31, 2002 at 10:38:42PM +1100, Fergus Henderson wrote:
> > > On 31-Oct-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> > > > I would a line saying that the MC++ interface is only recommended for
> > > > use when C# or the IL interface can't be used as it is by far the most
> > > > brittle interface.
> > > 
> > > In what sense is the MC++ interface "brittle"?
> >
> > It is brittle in the sense that both Tyson and I hate using it.  Things
> > go wrong all the time
> 
> More often than for the C# or IL interfaces?  Why?
> 
> > and when they do the error message you get out of
> > the MC++ compiler is quite often incomprehensible.
> 
I find it more difficult to get all the casts and levels of pointer
indirection right. This means that I am more likely to get an error
message and then it can be hard to comprehend that error message which
makes fixing the problem take longer.  I found this out the hard way.

As an aside the MC++ used to be produced by pragma_c_gen.m.
Seeing that there is an impedence mismatch between generating C and
MC++ that probably made the resulting code more convoluted then it
should've been.  I have since fixed that, so maybe now using MC++
is much less problematic.

It really doesn't matter that much, it was just a piece of experience
that both Tyson and I have had that may have been useful for users of
the system to help them choose the best foreign language to use.

> So the language reference manual should recommend against using the MC++
> interface because MSVC gives poor error messages?
> 
> I don't know, to me that just doesn't seem like an appropriate thing to
> put in the Mercury language reference manual.
> 
> > > I'm not going to advise people to use the IL interface rather than the
> > > MC++ interface, because the MC++ interface is much higher-level than
> > > the IL interface.
> > > 
> > > I could put in some advice recommending the use of the C# interface in
> > > preference to the MC++ interface on the grounds that it is more portable,
> > > I suppose.
> >
> > I do think a piece of advice along the lines of: this can be the most
> > difficult interface of the three interfaces to use, so only use it if
> > you really need to.
> 
> AFAIK it shouldn't be any harder to use than the C# or IL interfaces,
> except in that MC++ might be a more complicated language and/or might
> have a worse compiler.  But those are the usual issues when choosing a
> language.  I think people reading the Mercury language reference manual
> should be capable of making reasonable decisions about which of the
> three languages is appropriate for a given task without needing such
> advice.
> 
--------------------------------------------------------------------------
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