[m-dev.] completing the new foreign language interface

Jonathan Morgan jonmmorgan at gmail.com
Thu Aug 3 22:48:05 AEST 2006


On 31/07/06, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
> On Mon, 31 Jul 2006, Jonathan Morgan wrote:
> > It may interest you to know that these changes have broken the .NET
> > backend, which now cannot be built even under .NET 1.1.  Various bits
> > of the foreign library that have been implemented in C# rely on
> > calling pragma export'ed predicates, that now do not work.
>
> I expected something like that might happen.  It's because the pragma
> export version of exports has been changed so that it gets turned into
> foreign_export("C", ...).  Previously, the export used to go to all
> backends.  The fix is (probably) pretty straightforward, e.g. add
> foreign_export("IL", ...) decls for the procedures that need exporting.

I tried doing that for dir.m, and it gave many duplicate method errors
when compiling the resultant IL.  It seems to be producing three
definitions for every exported method, for some unknown reason.

> > Interestingly, it seems to be on the same calls that .NET 2 csc was
> > failing on.  This might mean that, if we complete foreign_export on
> > the .NET backend, we will be closer to getting it building under .NET
> > 2.
>
> foreign_export("IL", ...) should be working, so it's really only the
> C# and MC++ versions that need to be implemented. **

It was just a thing that I noticed, that all the .NET 2 (and Mono)
failures were on calls to exported methods.  Whether that means that
there is some subtle bug in the old pragma export that .NET 1 accepts
I don't know, but it was one possible theory.

After foreign_export("C#", ...) is working, at least some of the
exports should export to C# rather than IL, since they are only used
in C# foreign code.  Ones that are intended to be exported to other
modules should probably be exported to IL.

Jon
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list