[m-dev.] IL, Mono and Portable .NET

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Feb 1 22:20:49 AEDT 2006

On Wed, 1 Feb 2006, Jonathan Morgan wrote:

> Any idea how much work it would be to natively support Mono or DotGnu for
> the IL backend with both mmake and mmc --make?

I've just tried it with DotGNU and compiled most of the library with both
mmake and mmc --make.  It looks like there is a bug in the MLDS backend that
causes it to duplicate definitions in the IL code when compiling
library/injection.m (which is where it dies for me at the moment)

> Is it likely to be just a matter of adding their programs to the configure
> script and then choosing command line options depending on the compiler, or
> will more work be needed to get the IL compiling?

Essentially the former, probably some of the XXX comments in
scripts/Mmake.vars.in also need to be addressed.  The patch below partially
adds support for DotGNU.

> I think it would also be necessary to add a command line option to disable
> MC++, and have that on by default if no MC++ compiler is detected (the only
> MC++ code in the standard library is in benchmarking.m).

The only MC++ code I can see in benchmarking.m is commented out anyway; if at
all possible it should just be implemented in C#.

> Also, it's worth noting that (with patches committed recently) Mercury's IL
> backend works perfectly with the .NET SDK 1.1 (which is probably a better
> thing to recommend).  I haven't yet tried 0.12.2 to see if it works out of
> the box, but it should do.

There shouldn't be any difference with 0.12.2.

> I would like to test it with .NET Framework 2.0, but I haven't yet got hold
> of all the necessary compilers.  Expect results sometime.

Great! Looking forward to them.


Estimated hours taken: 1
Branches: main

	Add some preliminary support for using the il grade with DotGNU.

	Avoid a warning.

Index: aclocal.m4
RCS file: /home/mercury1/repository/mercury/aclocal.m4,v
retrieving revision 1.24
diff -u -r1.24 aclocal.m4
--- aclocal.m4	19 Feb 2004 23:47:46 -0000	1.24
+++ aclocal.m4	1 Feb 2006 10:53:11 -0000
@@ -227,7 +227,8 @@
 MS_CL=`basename "$MS_CL"`

 # Check for the C# (C sharp) compiler.
+# cscc is the DotGNU C# compiler.
+AC_PATH_PROGS(MS_CSC, csc cscc)
 MS_CSC=`basename "$MS_CSC"`

 # We default to the Beta 2 version of the library
@@ -270,10 +271,16 @@

+# Check for the assembly linker.
+# ilalink is the DotGNU assembly linker.
+AC_PATH_PROGS(MS_AL, al ilalink)
+MS_AL=`basename "$MS_AL"`
Index: library/rtti_implementation.m
RCS file: /home/mercury1/repository/mercury/library/rtti_implementation.m,v
retrieving revision 1.62
diff -u -r1.62 rtti_implementation.m
--- library/rtti_implementation.m	27 Jan 2006 05:52:14 -0000	1.62
+++ library/rtti_implementation.m	1 Feb 2006 10:31:15 -0000
@@ -1696,6 +1696,8 @@
     get_subterm(TypeInfo::in, Term::in, Index::in, ExtraArgs::in) = (Arg::out),
+    // Mention TypeInfo_for_U to avoid a warning.
     int i = Index + ExtraArgs;
     try {
         // try low level data
Index: scripts/Mmake.vars.in
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.100
diff -u -r1.100 Mmake.vars.in
--- scripts/Mmake.vars.in	25 Jan 2006 03:27:38 -0000	1.100
+++ scripts/Mmake.vars.in	1 Feb 2006 10:53:13 -0000
@@ -261,7 +261,7 @@

 # MS_AL is the Microsoft assembly linker, which creates assemblies.
-MS_AL		= al
+MS_AL		= @MS_AL@

 # MS_CSC is the command line version of C# compiler
 # XXX we should also support the Portable.NET and Mono C# compilers,
@@ -269,7 +269,7 @@
 # (What about Rotor?)

-MS_CSC		= csc
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