You will need to make use of three different software packages for this course:
Because sml-mode provides a fairly good indenting algorithm, we will require that you use Emacs until later in the course. Emacs will also give you warnings when exceeding the 80-character line limit -- something you will certainly find useful.
Installing SML and Emacs
- Download the self-installing .exe for Windows (5.3 MB) and run it.
- After installing SML/NJ, download this ZIP archive (9.3 MB) Emacs with SML Mode installed, plus a few minor CS 312 customizations.
- Extract the contents of the archive to the
C:\Program Files\directory. Be sure to extract preserving the directory tree structure (options depend on your software). For the next step to work, you will need to put it in that location. (If you really object to
C:\Program Files\Emacs\, ask for assistance.)
- You should now have a directory,
C:\Program Files\Emacs\. Go to this directory and double-click either
sethome.bat(for Windows 95/98/ME) or
home.reg(for Windows NT/2000/XP). This will add an environment variable
HOMErequired for Emacs to work correctly.
- Go to the
C:\Program Files\Emacs\bin\, and double-click the
addpm.exefile. This will add some necessary registry entries and place the appropriate items in your Start Menu. If when starting Emacs you get an error about fonts, you must read the directions at the bottom or the rest of your configuration will be incorrect.
- Restart your computer.
Note: For installation of SML/NJ on Windows 2000 or Windows XP, you may experience some difficulties after installing. The problem is that the system path variable is not being set correctly. Here is a workaround: Follow the instructions above. Click Start -> Run and type "cmd". If you get a command window, you are ok. Otherwise do the following: Right click on My Computer -> Properties -> Advanced tab -> Environment Variables -> System Variables -> Path -> Edit. Cut the value of the path variable and paste it back again. Click OK to close everything and try Start -> Run -> cmd again. You should be ok.Setting up your newsreader
- You may use any news reader you like, but you need to have at least one. These instructions are for Outlook Express. To set up a news account in Outlook Express, first start up Outlook Express and exit out of the myriad wizards that start up.
- Once at the main screen, choose Accounts... from the Tools menu.
- Choose to make a new News... account from the Add button.
- Enter your name, click next.
- Enter your e-mail address, click next.
- Enter newsstand.cit.cornell.edu for the name of the news server, check the authentication box, click next.
- Enter your Cornell netid for the account name and your CIT password, click next.
- Click finish and close.
- Choose Newsgroups... from the Tools menu to select the newsgroups you want to read. The newsgroups for this course are cornell.class.cs312 and cornell.class.cs312.talk.
Working versions of SML/NJ are available for Macintosh under OS X (download here). The install instructions are located in file
INSTALLof each version's FTP directory. We don't recommend a specific version (anything after 110.33 will work on OS X) nor do we provide detailed installation instructions. The working versions differ from the release version in various ways, particularly regarding Compilation Manager, library use, and error messages. Therefore you should expect to have a bit of difficulty with this as the course progresses.
You can use another SML implementation as well. MoscowML is a good option; however, all assignments must compile and run with SML/NJ on PCs, so if you develop your assignment on your Mac, be sure to test it out under SML/NJ on a PC before submitting.
Follow the instructions for installing SML/NJ version 110.0.7. Here are step-by-step instructions for both SML/NJ and Emacs installs.Installing CS 312 Software on Linux ## Download smlnj: ## For Debian or Redhat: wget ftp://ftp.research.bell-labs.com/dist/smlnj/release/110/RPMS/smlnj-110.0.7-4.i386.rpm" ## For other linux distributions (or if you prefer to compile from source), ## visit http://cm.bell-labs.com/cm/cs/what/smlnj/install/ for SML/NJ. ## Make a Debian package (skip this step if using Redhat): alien smlnj-110.0.7-4.i386.rpm ## Install (choose one of the following two commands) ## Debian: dpkg -i smlnj_110.0.7-5_i386.deb ## Redhat: rpm -i smlnj-110.0.7-4.i386.rpm ## Get the mode for emacs (Note, if you use Vim, it is already there ## and the colorization looks better) wget ftp://ftp.research.bell-labs.com/dist/smlnj/contrib/emacs/sml-mode-3.3.tar.Z ## Put it somewhere :) mv sml-mode-3.3.tar.Z /usr/share/emacs/site-lisp cd /usr/share/emacs/site-lisp ## And extract it. tar -xvzf sml-mode-3.3.tar.Z ## Modify your .emacs to take sml into account. You might need to comment ## or modify the first lines regarding SML in the CS312 .emacs to have: (setq load-path (cons "/usr/share/emacs/site-lisp/sml-mode-3.3/" load-path)) (autoload 'sml-mode "sml-mode" "Major mode for editing SML." t) (setq sml-mode-info "/usr/share/emacs/site-lisp/sml-mode-3.3/sml-mode.info") (setq sml-program-name "sml")
As Emacs is included with almost every Unix distribution these days, you only need to get support for sml-mode 3.3. Download and unpack the archive to some location on your computer. If you do not already have an .emacs file (in other words if you don't normally use Emacs), download this .emacs file and put it in your home directory. Make sure you modify the paths in the .emacs file so that they point to the location of the sml-mode files. If you already use Emacs, you should look through our .emacs file and take what parts of it you find useful.
The .emacs file we distribute tries to pick a font for you. If you have an odd system configuration, you may get an error message about not finding a good font to use. This will interrupt the emacs startup sequence, so you have to fix it even if the default font looks ok. To fix it, type in the scratch buffer (the first thing you see when it starts)
(w32-select-font) and hit C-j (control-J). Pick a font you like and edit your .emacs (using Notepad or Emacs itself) to change the lines for picking font -- look for Courier New -- to whatever you selected.