[MLton-user] Strange type problem in OS.Process

Dan DuVarney duvarney at reactive-systems.com
Fri Nov 7 10:34:50 PST 2008


 
Greetings all:

I am trying to use the MinGW / SVN r6941 version of MLton.
I installed it using the .msi installer and created a version of msys which
uses the same binaries and libraries provided by the .msi file.

Hello world compiles and runs fine. However, MLton insists that type
OS.Process.status is not an equality type, which causes many programs
to fail to compile. Below I have appended a small program, and the
output of MLton --verbose 3.

I am doing this on a centrino pro x86 processor running Windows XP
professional.
Does anyone know if the error I am getting is likely due to some
mis-configuration
on my part, or is it an actual MLton bug?

Before this I tried the 20070826 release, but I kept running into the
known bug in
which the attempt to page the heap to disk fails. I'd be grateful for
any suggestions
on what to try next.

Thanks in advance,

Dan

---- systest.sml
-----------------------------------------------------------------

val cmd = "/bin/ls"
val pr = TextIO.print
fun prLn x = (pr x; pr "\n")

val (OS.Process.status) =
    let
      val status = OS.Process.system cmd
    in
      if status = OS.Process.failure then
        pr (cmd ^ " failed")
      else
        pr (cmd ^ " succeeded");
      status
    end

--- output of mlton -verbose 3 systest.sml
----------------------------------------

MLton starting
MLton MLTONVERSION (built Thu Oct 16 02:32:53 2008 on orange)
  created this file on Fri Nov 07 13:27:34 2008.
Do not edit this file.
Flag settings:
   align: 4
   atMLtons: (systest, @MLton, --)
   chunk: chunk per function
   closureConvertGlobalize: true
   closureConvertShrink: true
   codegen: x86
   contifyIntoMain: false
   debug: false
   defaultChar: char8
   defaultWideChar: widechar32
   defaultInt: int32
   defaultReal: real64
   defaultWord: word32
   diag passes: []
   drop passes: []
   elaborate allowConstant (default): false
   elaborate allowConstant (enabled): true
   elaborate allowFFI (default): false
   elaborate allowFFI (enabled): true
   elaborate allowPrim (default): false
   elaborate allowPrim (enabled): true
   elaborate allowOverload (default): false
   elaborate allowOverload (enabled): true
   elaborate allowRebindEquals (default): false
   elaborate allowRebindEquals (enabled): true
   elaborate deadCode (default): false
   elaborate deadCode (enabled): true
   elaborate forceUsed (default): false
   elaborate forceUsed (enabled): true
   elaborate ffiStr (default):
   elaborate ffiStr (enabled): true
   elaborate nonexhaustiveExnMatch (default): default
   elaborate nonexhaustiveExnMatch (enabled): true
   elaborate nonexhaustiveMatch (default): warn
   elaborate nonexhaustiveMatch (enabled): true
   elaborate redundantMatch (default): warn
   elaborate redundantMatch (enabled): true
   elaborate sequenceNonUnit (default): ignore
   elaborate sequenceNonUnit (enabled): true
   elaborate warnUnused (default): false
   elaborate warnUnused (enabled): true
   elaborate only: false
   emit main: true
   export header: None
   exn history: false
   generated output format: executable
   gc check: Limit
   indentation: 3
   inlineIntoMain: true
   inlineLeafA: {loops = true, repeat = true, size = Some 20}
   inlineLeafB: {loops = true, repeat = true, size = Some 40}
   inlineNonRec: {small = 60, product = 320}
   input file: systest
   keep CoreML: false
   keep def use: true
   keep dot: false
   keep Machine: false
   keep passes: []
   keep RSSA: false
   keep SSA: false
   keep SSA2: false
   keep SXML: false
   keep XML: false
   extra_: true
   lib dir: c:\msys\1.0\mingw\lib\mlton
   lib target dir: c:\msys\1.0\mingw\lib\mlton\self
   loop passes: 1
   mark cards: true
   max function size: 10000
   mlb path vars: [{var = MLTON_ROOT, path = $(LIB_MLTON_DIR)/sml}, {var
= SML_LIB, path = $(LIB_MLTON_DIR)/sml}]
   native commented: 0
   native live stack: false
   native optimize: 1
   native move hoist: true
   native copy prop: true
   native copy prop cutoff: 1000
   native cutoff: 100
   native live transfer: 8
   native shuffle: true
   native ieee fp: false
   native split: Some 20000
   optimizationPasses: [<ssa2::default>, <ssa::default>,
<sxml::default>, <xml::default>]
   polyvariance: Some {hofo = true, rounds = 2, small = 30, product = 300}
   prefer abs paths: false
   prof passes: []
   profile: None
   profile branch: false
   profile C: []
   profile IL: ProfileSource
   profile include/exclude: [(Seq [Star [.], Or [Seq [Seq [[$], [(],
[S], [M], [L], [_], [L], [I], [B], [)]]]], Star [.]], false)]
   profile raise: false
   profile stack: false
   profile val: false
   show basis: None
   show def-use: None
   show types: true
   target: self
   target arch: X86
   target OS: MinGW
   type check: false
   verbosity: Detail
   warn unrecognized annotation: true
   zone cut depth: 100
   Compile SML starting
      pre codegen starting
     parseAndElaborate starting
Error: systest.sml 10.17.
  Function applied to incorrect argument.
    expects: [<equality>] * [<equality>]
    but got: [<non-equality>] * [<non-equality>]
    in: = (status, OS.Process.failure)
Error: systest.sml 6.6.
  Undefined constructor: OS.Process.status.
     parseAndElaborate finished in 1.64 + 2.28 (58% GC)
     parseAndElaborate stats
        core-ml size = 37,590,060 bytes
        property list numPeeks = 6133856
        property list maxLength = 3
        property list average position = 0.264
        hash set numPeeks = 87333
        hash set average position = 0.973
      pre codegen raised in 1.95 + 2.28 (54% GC)
   Compile SML raised in 1.95 + 2.28 (54% GC)
MLton raised in 1.95 + 2.28 (54% GC)
compilation aborted: parseAndElaborate reported errors


-- 
Dan DuVarney
Senior Software Engineer         Reactive Systems Inc.
duvarney at reactive-systems.com    +1 (919) 324-3507 ext. 103
OpenPGP (GnuPG) public key file:
http://www.reactive-systems.com/~duvarney/pgp_public_key.txt




More information about the MLton-user mailing list