SML# Document Version 3.7.1
6 Setting up SML# programming environment

6.5 smlsharp command modes

smlsharp has the following execution modes.

interactive mode

When smlsharp is invoked without any parameter, 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.