Harvard University, FAS

Home
Syllabus
Lecture Notes

ML Resources
MIPS and SPIM

Computer Science 153
Principles of Programming Language Compilation

ML Resources

The Book
  • The book for the course is Modern Compiler Implementation in ML by Andrew Appel.
  • You should be able to order the book from bigwords.com.
  • Note that Appel has a number of versions of the book (for ML, Java, and C) and multiple editions. Just about any version of the book will be okay, but obviously you're better off with the ML version for this course.
Online Other ML Compilers Books
Using SML/NJ on nice

If you are using the nice servers, you will need to set your environment to use our version of SML/NJ. The version of SML/NJ installed on the nice servers is much older, and some programs may not be compatible. To setup your environment place the following at the beginning of your .cshrc file:

 setenv SMLNJ_HOME ~lib153
 setenv PREPATH ~lib153/bin
Once you have done this, log back into the nice servers and type sml at your prompt. SML/NJ will start up and display its version number. It should look like this:
# sml
Standard ML of New Jersey v110.49 [FLINT v1.5], September 13, 2004
- 
If you have any trouble, contact your friendly Professor or TF.

Setting up SML for use in Xcode

Stefan Wernli provided the following configuration files and readme for setting up Xcode on Macs to get syntax hilighting. You can download the zip file.

Setting up SML with Emacs

On the nice servers, you can setup the emacs SML mode by inserting the following lines into your .emacs file.

(setq load-path (cons "~lib153/lib/emacs" load-path))
(autoload 'sml-mode "sml-mode" "Major mode for editing SML." t)
(setq auto-mode-alist
      (append '(("\\.sml$" . sml-mode) 
                ("\\.sig$" . sml-mode)) auto-mode-alist))

After reloading emacs, the SML mode will automatically load when you open a .sml or .sig file. You can also enter the SML mode by typing "M-x sml-mode" in the emacs commands buffer.

You can find more information on the SML emacs mode at: SML mode for Emacs . There are a number of versions of the sml-mode lying around, but they all more or less work the same, so it shouldn't matter which one you use.