[m-dev.] "executables" in the java grade

Julien Fischer jfischer at opturion.com
Wed Dec 3 15:12:40 AEDT 2014


Hi all,

I've recently been experimenting with versions of the Mercury compiler built in
the java grade.  With a little bit of fiddling about it is possible to get a
working Mercury compiler that runs on the JVM.  One of the main bit of fiddling
about is related to how we build "executables" in the java grade.  Currently,
when we do

     $ mmc --grade java --make foo

we end up with a wrapper script (or batch file) in our current working
directory plus a bunch of class files in Mercury\classs.  With the current
install target in the compiler directory this ends up not working because only
the wrapper script ends up being copied into INSTALL_PREFIX/bin, not the class
files.  I think a better approach to handling "executables" for the java grade
would be to generate a .jar file containing all the program's class files along
with the wrapper script and have the wrapper script reference that instead of
the class files in the Mercury directory.  Any objections?

[I tried bootstrapping the Mercury compiler with the Java version of the
compiler, it's fairly slow but I got as far as building the library
optimization interfaces in hlc.gc before building io.opt caused it to run out
of stack space.  Presaumbly, bumping up the amount of stack space will allow it
to build, but I haven't tried that yet.]

Cheers,
Julien.



More information about the developers mailing list