SML & SML/NJ
Standard ML (SML) is a safe, modular, strict, functional, polymorphic programming language with compile-time type checking and type inference, garbage collection, exception handling, immutable data types and updatable references, abstract data types, and parametric modules. It has efficient implementations and a formal definition with a proof of soundness. SML/NJ is the implementation of SML we will be using in this course. Other well-known implementation include MLton, and Poly/ML. The parts of the course concerned with programming in SML will, to a large extent, follow R. Harper's Programming in Standard ML (available for online reading), supplemented by the lecture notes. For the more theoretical parts, you may also find R. Harper's Practical Foundations for Programming Languages (available online) useful.
If you're printing chapters from Programming in Standard ML and would like to save paper or printing costs by printing "2-up", download this version enlarged to 125% and select "2-up"/"Multiple pages per sheet"/etc. when printing. That should give you a copy with small, but still legible text, without enormous margins.
To get you started with SML and SML/NJ, consult the FAQ page. The following external resources might also be useful.
- SML/NJ User's Guide, including information on downloading and installing SML/NJ.
- The SML Basis Library, including information on useful common functions included with most implementations of SML.
- Tips for Computer Scientists on Standard ML, by Mads Tofte.
- About Coding Style, an SML style guide written by students at CMU.
- SML/NJ Literature, including further tutorials.
- L. Paulson: "ML for the Working Programmer (2nd edition)". Cambridge University Press, 1996. (Available on Amazon)
Functional programming in practice
If you are interested in learning more about how and where functional programming is used in industry, check out the following.
- Why the next language you should learn should be functional, Y. Minsky, ACMQueue, Sept 2011.
- Rise of Functional Programming, Dr. Dobbs
- Haskell in Industry
- OCaml success stories
- Commercial users of Erlang
- Commercial Users of Functional Programming conference
- F#: Combining ML and .NET. Developed by Microsoft.
Performance Comparisons
For an interesting recent comparison between programming languages, see the ray tracer language comparison. For some older articles on why functional programming matters, see the following.
- John Huges: Why Functional Programming Matters
- Philip Wadler: Why No One uses Functional Languages
- Paul Hudak and Mark Jones: Haskell vs. Ada vs. C++ vs. Awk vs. ...: An Experiment in Software Prototyping Productivity
Programming Contests
Once you have mastered SML, you may be intrigued by the International Conference on Functional Programming (ICFP) programming contest held every year. Check out the most recent contest here. Note that this contest does not require you to program in a functional language, but nevertheless many people choose a functional language.
Emacs
Emacs (available in two implementations, GNU Emacs and XEmacs) is a powerful and widely used family of text editors. It is well-suited for SML development, since it is highly customizable and extensible, and there exists a package for emacs called SML-mode, which makes it easy to interact with an SML/NJ session directly within the editor. See the FAQ page for more detailed information on obtaining, installing, and using both emacs and SML-mode for emacs.