Although having a local SML/NJ available will make the tour easier to experiment with, it is possible to run the code samples on the page. The code runner comes with several libraries preloaded:
(NOTE: This is a new feature! Please file issues at the Github issue tracker.)
$ git clone https://github.com/Saityi/a-tour-of-standard-ml.git
$ cd a-tour-of-standard-ml
$ sml
Standard ML of New Jersey v110.97 [built: Wed Apr 22 09:39:44 2020]
- (* You may change the directory from within Standard ML *);
- OS.File.chDir("./examples");
val it = () : unit
- use "setup.sml";
[opening setup.sml]
Hello, world!
Note that REPL examples are cleaned up slightly; the text that appears in your REPL may differ somewhat, as a result.
(* examples/setup.sml *)