[MLton-user] The -runtime command line switch

Stephen Weeks MLton-user@mlton.org
Tue, 27 Sep 2005 11:15:50 -0700


> I'm a little confused about the -runtime command line switch. I wanted
> to create MLton executables that used a little less memory when run on
> a 4Gb machine, so should I type
> 
> mlton -runtime ram-slop -runtime 0.4 -runtime -- t.sml
> 
> or is the following sufficient?
> 
> mlton -runtime ram-slop -runtime 0.4 t.sml

The latter is sufficient.  In fact, so is

  mlton -runtime 'ram-slop 0.4' t.sml

> Also, I was intrigued by the -runtime stop option, but didn't know how
> to use it.

An executable created with -runtime stop doesn't process any @MLton
arguments.  This is useful to create an executable, e.g. echo, that
must treat @MLton like any other command-line argument. 

  % mlton -runtime stop echo.sml
  % echo @MLton --
  @MLton --

> I looked through the documentation but couldn't find the answers to
> these questions: simply adding a couple of examples in the
> "compile-time options" section of the user guide would help a lot.

Good questions.  I've hopefully answered them above, as well as at

  http://mlton.org/CompileTimeOptions