This works in SML (Standard ML of New Jersey). Here is a full transcript.
% sml
Standard ML of New Jersey, Version 0.93, February 15, 1993
val it = () : unit
- print("hello world!\n");
hello world!
val it = () : unit
The only parts I typed in where the sml invocation and the program
print("hello world!\n");

submitted by: (Raphael Finkel)