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, MoscowML, 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 online), 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.
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.
- A Gentle Introduction to ML, by Andrew Cumming.
- 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.
- R. Harper: "Proof-directed debugging". Journal of Functional Programming, 9(4):463--469, 1999. (Available on CiteSeer)
- L. Paulson: "ML for the Working Programmer (2nd edition)". Cambridge University Press, 1996. (Available on Amazon)
Functional programming in practice
Functional programming has emerged as the central organizing principle in programming language design, and is increasingly important in industrial as well as academic settings. If you are interested in learning more about how and where functional programming is used in industry, check out the following.
- Commercial Users of Functional Programming
- Haskell in Industry
- O'Caml success stories
- F#:Combining the efficiency, scripting, strong typing and productivity of ML with the stability, libraries, cross-language working and tools of .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.
- Why Functional Programming Matters, by John Hughes.
- Why No One uses Functional Languages, by Philip Wadler.
- Haskell vs. Ada vs. C++ vs. Awk vs. ...: An Experiment in Software Prototyping Productivity, by Paul Hudak and Mark Jones.
- Functional Programming for the real world, by Rowan Davies
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.