[m-dev.] pedantic quibble...

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Dec 23 13:06:40 AEDT 1999


On 23-Dec-1999, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> On 23-Dec-1999, Michael Day <mcda at cat.cs.mu.OZ.AU> wrote:
> > 
> > > :- import is used by the C interface.  Pedantically, I'm thinking this
> > > might be better as :- import_foreign or something like that.
> > 
> > Will the C interface become a "host language" interface once MLDS kicks in
> > and Mercury is targeting every language that looks remotely plausible?
> 
> Not quite.   I have plans for a general foreign language interace which
> will map down to the "host language" if it is possible, but will
> otherwise compile into a separate module and .o file (or whatever).

Yes, the general idea is to add an new argument to `pragma import',
`pragma export', `pragma c_header_code' and `pragma c_code' (which
would be renamed `pragma foreign_decls' and `pragma foreign_code'
respectively) that would specify the language.
If the language is the same as the target language, then the compiler
can include the code directly in the target language file that
it outputs, and it can also inline that code.
Otherwise, the foreign code needs to be generated in a separate file
that will be compiled by the compiler for the specified foreign
language.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- 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