[MLton-user] mlton and netbsd

fulvio ciriaco oivulf at gmail.com
Sat Oct 10 00:12:56 PDT 2009


From: Matthew Fluet <mtf at cs.rit.edu>
Subject: Re: [MLton-user] mlton and netbsd
Date: Fri, 9 Oct 2009 13:03:11 -0400 (EDT)

> On Tue, 6 Oct 2009, fulvio ciriaco wrote:
>> fortunately bootstrapping with smlnj-mlton resulted quite feasable,
>> as soon as I increased memory to 2 Gb.
>> I used smlnj v110.70.
>> I left it compiling in the evening and found it done in the morning.
> 
> Well, bootstrapping mlton with mlton is a 10min compile; so don't get
> the impression that the speed with which SML/NJ executes the compiler
> is the speed with which MLton executes the compiler.
>
Yes, I had already noticed that mlton-mlton is much smaller and
faster than smlnj-mlton.
 
>> Only the following needed fixing:
>> the install procedure
>> the mlyacc Makefile, seems to require mlyacc, I patched it so:
>> -               mllex src/yacc.lex && \
>> +               (mllex src/yacc.lex || ml-lex src/yacc.lex) && \
>> -               mlyacc src/yacc.grm && \
>> +               (mlyacc src/yacc.grm || ml-yacc src/yacc.grm) && \
>>                chmod -w src/yacc.grm.*
>> so it accepts ml-yacc from smlnj when mlyacc is not found.
> 
> You would presumably also need SML/NJ's ml-yacc and ml-lex for the
> <src>/mlton/front-end/Makefile (not just for the
> <src>/mlyacc/Makefile), since none of the generated files are part of
> the source distribution.
> Also, the above is a little noisy, as the shell will print an error
> when it doesn't find mllex or mlyacc.
> 
> In any case, I've committed a patch that looks for MLton's tools
> first, and then falls back to SML/NJ's tools.
> 
> However, bootstrapping from SML/NJ is not considered an "official"
> method of compiling MLton.  Please do not make SML/NJ a build
> requirement for MLton.
>
I had not that many choices. Probably there is some way to cross
compile, but smlnj-bootstrap was easier to discover.
Anyhow, I now have a working mlton package and can do a standard
compilation.
I committed wip/mlton-svn to pkgsrc, for the moment with the
choice for bootstrap, just until I can upload the package in
an official place.
Keeping a working version of mlton-mlton will avoid the necessity
to bootstrap by means of smlnj. 
>> Also, benchmark/main.sml has no support for netbsd and is not
>> documented for mlton:
> 
> The benchmark program isn't part of the installed programs; it is only
> used by developers, and isn't fully documented.  (There are a number
> of other flags besides those on the usage line.)  And it has no
> explicit support for many SML/NJ platforms.
> 
> I've committed a more robust method of determining the SML/NJ heap
> suffix.
> 
Oh, it was the first place where I looked for testing the
compiler.
Thank you for promtly patching the Makefiles, this will make
the port much cleaner.
Fulvio



More information about the MLton-user mailing list