[MLton] runtime optimization flags?
Vesa Karvonen
vesa.karvonen at cs.helsinki.fi
Mon Nov 27 23:23:44 PST 2006
Quoting Matthew Fluet <fluet at cs.cornell.edu>:
> Adam Goode:
> > 1. GNU Make gives us 2 kinds of variables, and I think the MLton
> > makefiles are using the sub-optimal kind:
> > http://www.gnu.org/software/make/manual/html_node/Flavors.html
> ...
> > Patch 1 replaces all instances of plain old "=" with ":=", except in
> > packages/freebsd/Makefile since I have no way of testing it.
[...]
> I've applied both patches to trunk. Thanks for putting them together.
I'm getting the following error compiling after the Makefile patch:
Error: ../lib/mlton/basic/file-desc.sml 14.32.
Function applied to incorrect argument.
expects: _ * (_ -> [word])
but got: _ * (_ -> [Word64.word])
in: o (Word.layout, fdToWord)
parseAndElaborate raised in 2.83 + 1.01 (26% GC)
I don't fully understand the effect of just switching from = to := in
makefiles, but I'm guessing that variable assignments from child
makefiles are now visible in parent makefiles. Looking at the source
of the above error, I patched the file with changes from the 64-bit
branch and it seems to fix the symptoms and the regressions pass. See
the patch below. I don't know if this is the right thing to do,
however. Another possibility might be to change the Makefiles.
-Vesa Karvonen
Index: lib/mlton/basic/file-desc.sml
===================================================================
--- lib/mlton/basic/file-desc.sml (revision 4863)
+++ lib/mlton/basic/file-desc.sml (working copy)
@@ -11,7 +11,8 @@
type t = file_desc
- val layout = Word.layout o fdToWord
+ val toString = SysWord.fmt StringCvt.DEC o fdToWord
+ val layout = Layout.str o toString
fun move {from, to} =
if from <> to
More information about the MLton
mailing list