[MLton-user] Re: [MLton] MLton: A few questions

Ville Laurikari ville at laurikari.net
Thu Mar 26 13:11:31 PST 2009


On Wed, Mar 25, 2009 at 05:18:50PM +0100, emil artin wrote:
> Hi,
> 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!

For any supported platform, you just run "make all-no-docs" to build
it, or "make all" if you have the LaTeX toolset needed for building
the documentation.

You need a working MLton in path, though, to be able to do a normal
compile of MLton.  You can find binaries at
  http://mlton.org/Download
and
  http://mlton.org/Experimental

I have recent 64-bit builds of MLton for AIX and Solaris (amd64).
I'll upload the binaries on the Experimental page so you can give it a
whirl.

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

No.  In theory, I suppose it would be possible to modify MLton to work
with a different compiler, but I don't see the point.

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

SML/NJ is not needed, unless you want to bootstrap using SML/NJ.
Normally, you would use MLton to build MLton.

You do need a set of GNU tools and libraries.  I believe these are
sufficient:
  - gcc
  - gmp
  - GNU make
  - bash

In addition, the build process uses things like tar, patch, sed, grep,
find, "mkdir -p", etc.  You may have to get the GNU versions of these
as well, but probably not.

Also, to build MLton with itself, you need a couple of gigabytes of
memory.  You may get by with 1.5G or possibly even just one gig, but
I'd consider two gigabytes a minimum.

> 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?

Yes, except on the most popular architectures (x86 and amd64) we have
native support and generate assembler (.S) instead of C.  On other
architectures, where MLton doesn't have a native code generator, MLton
generates C code instead of assembler.

Compiling the .c and .S files and linking the final executable is done
with GCC.

--
http://www.iki.fi/vl/



More information about the MLton-user mailing list