Ch.5 Setting up SML# programming environment

§ 5.7. smlsharp command modes

smlsharp has the following execution modes.

interactive mode

When smlsharp is invoked without any parameter as shown below:

$ smlsharp
SML# version 1.0.1 (2012-04-24 10:23:45 JST) for x86-linux
#

it executes the interactive session.

compile and link mode

When smlsharp is invoked with a single source file as shown below:

$ smlsharp file.sml
$

it compiles the source file file.sml, links the resulting object file and creates an executable program (with the name a.out by default).

compile mode

When smlsharp is invoked with -c switch as shown below:

$ smlsharp -c file1.sml fileN.sml
$

it compiles the given files file1.sml fileN.sml into object files file1.o fileN.o.

link mode

When smlsharp is invoked with a single interface files as shown below:

$ smlsharp file.smi
$

it assumes that file.smi is a top-level interface file, links all the object files corresponding to the interface files referenced from file.smi, and generates an executable file.

SML# also recognizes various command-line switches.

$ smlsharp --help

will print a help message describing available switches.