Information on Standard ML
Running Standard ML
- Generally the class will assume you are using the Standard ML of New Jersey
compiler, a free compiler developed at Bell Labs. This can be run on turing
using the command
sml, but if you'd rather use your own computer,
you can download it
for most operating systems, including Windows and Linux.
- This guide to using SML/NJ contains some very
useful information on the mechanics of running the compiler, using it
with emacs, and (perhaps most importantly) interpreting error messages.
- However, because the language has an official definition,
there are several other good, freely-available compilers available for the
language that you may use instead, including Moscow
ML (for many operating systems; it can also be run on turing via the command
mosml), Poly/ML (for many
operating systems) and MLton (for x86 machines).
Each implementation has its own advantages.
Learning Standard ML
- If you've done some SML programming in the past, the shortest way to get
up to speed may be to read through the SML
Overview for CS 131. This is meant to summarize the minimum knowledge
about SML needed to do the programming for this class. As such, it is very
condensed; if you find it too compressed then you might want to look elsewhere:
- Professor Hodas's course notes from past semesters of CS 80/131 include
several introductory lectures on Standard ML.
- Robert Harper at Carnegie Mellon University has written a tutorial Programming in Standard
ML (This is a rather long pdf file, so please don't send it to the
college printers.) Chapter 1 jumps right into a relatively complex ML
program; if this seems overwhelming you might go on to Chapter 2, which
starts back at the beginning with a more introductory approach.
- Andrew Cumming has written A
Gentle Introduction to ML
- There are several textbooks you can purchase on learning SML, including
Jeffrey Ullman's Elements
of ML Programming (ML97 Edition), Hansen and Rischel's Introduction
to Programming Using SML, and Laurence Paulson's ML
for the Working Programmer. Copies of all three books are also held
on reserve at the Sprague circulation desk.
- Documentation for the Standard
ML Basis (i.e., the standard library) is available on-line. Particularly
useful are the modules Int,
Real,
String,
and List,
but there are many others as well.