[MLton] MLton: A few questions

Matthew Fluet fluet at tti-c.org
Wed Apr 1 13:58:32 PST 2009


On Wed, 25 Mar 2009, emil artin wrote:
> I have a few questions about MLton which I want to ask
> and hope that experienced users on this list can answer my questions.
>
> 1) Is there any howto or guide about custom compilation of MLton?
>    I would like to compile a 64bit version of MLton on AIX and Solaris myself!

There are a number of pages on the mlton.org wiki that explain how to 
build mlton and port to a new system:
   http://mlton.org/SelfCompiling
   http://mlton.org/PortingMLton
   http://mlton.org/CrossCompiling

You should probably also read (and update, if you encounter something to 
the contrary) the platform specific notes:
   http://mlton.org/PlatformSpecificNotes

> 2) Is it possible (or sensible) to use a non gcc compiler (e.g. xlc on AIX)?

It might be.  I think that some of the Intel folks have used the Intel 
compiler, but I'm not sure.

In <src>/runtime/Makefile, you could change CC from 'gcc -std=gnu99' to 
something else, but you will probably have to change a lot of the flags.
This is for compiling the runtime library that is linked to an SML 
program.

As Dan mentioned, you can use the '-cc' option to mlton itself set an 
alternate command for the C compiler; note, however, that this command is 
invoked as a C compiler, as an assembler, and as a linker -- i.e., it uses 
the command as a driver program, much as gcc supports being invoked as a 
driver.

> 3) What are the prerequisites? I know about gmp and SML/NJ.
>    Is SML/NJ absolutely necessary?

No, SML/NJ is not necessary, but you otherwise need to have a binary build 
of mlton to compile mlton.

> 4) Does MLton generate an executable file from SML code by first compiling it into C
>    and then using a C compiler to compile it to an executable file?

As noted by others, this is one of the supported compilation strategies, 
and the only one for platforms other than x86 and amd64.  For those 
platforms, there is a native codegen that produces assembly.

> PS: Evidently the activities on MLton has been decreased dramatically during the past few months.
>      It seems that the project leaders don't have much time for further developement of MLton.
>      What is going on?

MLton is a volunteer project, so developers contribute when they have the 
resources to do so.  No one currently has support to do significant 
development on MLton and many of us have other responsibilities that take 
precedence.

-Matthew



More information about the MLton mailing list