Include the SML# installation directory in your command load path, so that you can run SML# by the name smlsharp. When invoked without any parameter, SML# stars its interactive session by printing the following message and waits for your input.
$ smlsharp
SML# version 4.2.0 (2025-03-24) for x86_64-pc-linux-gnu with LLVM 20.1
#
The “# ” character is the prompt SML# prints. In this document, we write “$ ” for the shell prompt.
After this message, the compiler repeats the following steps.
Read the user input up to “;”.
Compile the input program and execute it.
Print the result.
The following is a simple example.
# "Hello world";
val it = "Hello world" : string
The first line is the user input. The second line is the response of SML# system. As seen in this example, the compiler prints the result value with its type, and binds it to a name for subsequent use. If the user does not specify the name, the compiler uses “it” as the default name.