[Mono-list] Mercury on Mono (not successful) (now running in the labs:-)

Paolo Molaro lupus@ximian.com
Sat, 1 Mar 2003 12:02:50 +0100


On 02/28/03 Fergus Henderson wrote:
> > Is there a windows developer here? I someone can provide the code
> > that returns the path to the GAC, I'll add it to the default search path
> > when running in windows.
> 
> On my system it is in C:\WINNT\assembly\GAC, with each assembly under
> C:\WINNT\assembly\GAC\<namespace>\<version>__<publickeytoken>.

Well, I meant programmatically:-)
Maybe a better way to say it is: if a windows developer writes and tests
the 10 lines of code needed to make mono access the assemblies in the
MS GAC, I'll apply the patch;-)

> > There are still two issues:
> > 1) in the files you provided a type is referenced, but I could not find
> > it defined in any module:
> > 	 [mercury]mercury.private_builtin.ref_1
> > I guess a file is missing from the tarball.
> 
> No, that type is indeed referenced but not defined.  This is a currently
> not-yet-implemented part of the Mercury standard library.  I hadn't noticed
> that until now, because it works in Microsoft.NET.  It works because
> that type is never actually used at run-time.  Not sure what the ECMA
> standard says about this, but in any case I can fix our source to
> define that type.

Yes, please. We probably initialize too many types for some reason.
That type is referenced in a field in the generic_ref_2
class in store.dll, for example. I haven't traced why that class is
loaded and if it really needs to be loaded, I added a hack in my tree
to ignore the error if the class of the field is not found.

> > 2) references to nested types are encoded with (for example):
> > 	namespace = mercury.list
> > 	name = list_1/[|]_2
> > I always thought that was not allowed and that you should use a typeref
> > to the parent with:
> > 	namespace = mercury.list
> > 	name = list_1
> > and a typeref to the typeref with:
> > 	namespace = 
> > 	name = [|]_2
> 
> Well, we just spit out IL assembler and let ilasm.exe handle it.
> We generate the name 'mercury'.'list'.'list_1'/'[|]_2', which I
> believe is correct according to the ECMA spec.
> 
> > I guess we'll have to handle also this special case.
> 
> That would be good.

I added handling for that special case in my tree. After a bunch of
warnings about the missing type I get:
lupus@luna:/tmp/mercury/mercury_dotnet_hello$ mono hello.exe 
Hello, world

So, that's a good start, though I don't know how much real mercury code
the test uses to run. If you have more tests, I can try and see if they
run.  I'll clean up my changes and commit them to cvs later so that
other people can enjoy yet another language running in mono. 

Thanks!

lupus

-- 
-----------------------------------------------------------------
lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better