Skip to content

Instantly share code, notes, and snippets.

@creedasaurus
Created August 25, 2018 17:53
Show Gist options
  • Save creedasaurus/fb8c4c318b2e446d38ac7b3ae3c596a6 to your computer and use it in GitHub Desktop.
Save creedasaurus/fb8c4c318b2e446d38ac7b3ae3c596a6 to your computer and use it in GitHub Desktop.
Setting up Standard ML Environment on Mac/Windows

Standard ML

This is a cool functional programming language. Here's my tips for gettings set up.

Download/Install SML

Visit the official website for Standard ML and go to the current release.

  • For Windows it's as simple as downloading and running the MSI they list
  • For Apple computers, do yourself a huge favor now and go first install Brew
    • Then you can simply run brew install smlnj and bam! you've got it.

You can use SML in both mac/windows by simply running sml in the command prompt or terminal (you may need to reopen the terminal after installing before it'll be in your PATH)

Download VSCode

  • Get VSCode (no editor wars here... it's just simple and good. Use vim if you want)
  • Install the extension it suggests when opening a *.sml file or get it Here if you aren't sure.
  • Open VSCode settings from Preferences > Settings or something, and add this to your settings file if you dont want the sml.json warnings:
{
  "sml.ignoreMissingSmlDotJson": true
}

Exiting the SML process in your script

Add the following to the end of your *.sml scripts:

val _ = OS.Process.exit(OS.Process.success);

And also consider setting the CM_VERBOSE flag when running sml to avoid all the extra output if you don't need it.

# Mac/Linux
CM_VERBOSE=false sml example.sml

# Windows
set CM_VERBOSE=false & sml example.sml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment