Help Sessions
Tuesday, 7:30pm-9pm, Exley 113
Wednesday, 7:30pm-9pm, Exley 113
Thursday, 7:00pm-9pm, Exley 113
All times are US Eastern.
Teams
We will use Microsoft Teams for announcements and questions about
the course material / clarification questions about the assignments
(questions that don't require divulging any partial solutions to
problems). You are responsible for being current with the
information and discussions that are posted there.
SML
To install a local copy of sml/nj:
Mac OS
These directions worked on Mac OS Catalina/Big Sur.
- Start the Terminal application by selecting it from your
Applications folder or by typing Terminal into Spotlight.
- In the terminal, run
xcode-select --install
Run the installer that pops up if one does; otherwise you
already have the command line tools installed.
- Install the Homebrew package
manager according to the directions on that page. I.e. copy
the script into the Terminal and run it.
-
In the terminal, run
brew install rlwrap
.
-
In the terminal, run
brew install smlnj
.
- In the terminal, run
echo 'export PATH="/opt/local/bin:/usr/local/smlnj/bin:${PATH}"' >> ~/.bash_profile
- In the terminal, run
echo 'alias smlnj="rlwrap sml"' >> ~/.bash_profile
- If you are on the latest MacOS (Catalina, Big Sur) and don't have strong preferences about what unix shell you use,
run
chsh -s /bin/bash
(then type your mac password and hit enter when prompted) to
switch your default shell to BASH from the new default of zsh.
If you do have strong preferences about using zsh, then add the
equivalent of the above lines setting your PATH and smlnj alias
to your zsh startup files.
- Close and restart the terminal and you should be able to
run smlnj to start SML.
Work arounds:
Windows
These directions were tested on Windows 10. If you have an earlier
version and this doesn't work, here are
some
old
directions that might work.
- Use
this installer.
- Install the VSCode editor and run SML in its terminal
according to the directions below.
Text Editor
On a Mac, we recommend Atom or VSCode or Sublime Text or GNU emacs
for editing SML source files. Atom and VSCode allow you to run a
terminal inside of the editor, so you can run smlnj in there. emacs
has a special mode for running SML code, but is less
new-user-friendly. For Sublime, you can only run SML code from the
separate Terminal application.
On Windows, we recommend VSCode.
VSCode
- Install VSCode
and start it.
- On the left-hand side, you should see an icon that looks like
three squares with one square sticking out. This is the place to
install extensions. Install the following two extensions:
- vscode-better-sml
- Tomorrow and Tomorrow Night Theme from Microsoft.
Click on this extension, and use the Set Color Theme button
at the top to select one of the themes if it doesn't already
prompt you to do so.
This should make colorful syntax highlighting work for SML
code.
- Create a folder for your COMP 212 work and select it
via Open Folder... (Windows) or Add folder to
Workspace... (Mac). You should put the .sml files you
download from the course web site into this folder.
- You can start a terminal in VSCode by using the Terminal / New
Terminal menu option.
- Type smlnj (Mac) or sml (Windows) to start SML.
Atom
- Install Atom.
- Install
the language-sml package by going to Prefrences/Settings,
choosing the Install tab, and then typing it in to the search
box at the top.
-
You can run smlnj in the built-in Mac Terminal application, but
you want a terminal in Atom, you can install
the platformio-ide-terminal package. Then, you can
start a terminal by going to Packages /
platformio-ide-terminal / New Terminal...
Sublime Text
Sublime Text is
available here; get
version 3.
More specifically:
- Download the installer for your operating system. On Windows,
follow the instructions in the installer. On Mac, navigate to your
downloads and open the .dmg file. A pop-up
containing your local Applications folder and a Sublime Text 3
file. Drag the Sublime Text file into the Applications folder.
- On Windows, you can open Sublime Text through the Start Menu.
On Mac, you can open Sublime Text in one of three ways:
- Finder: Open a new Finder window, navigate to your
Applications folder (it should be listed in the left-hand
column) and double-click on Sublime Text.
- Terminal: In terminal, enter “cd /Applications ; open
Sublime\ Text.app/“.
-
Launchpad: Open Launchpad and search for Sublime Text.
You may want to put a shortcut to Sublime Text on your desktop/in
your Dock.
- Install Package Control: Go to the Tools menu, click on Command
Pallet, and then type Install Package Control.
- To get syntax highlighting, install the "SML (Standard ML)"
package:
- Press on Tools > Command Palette in the menu bar and
search for “install package”, then press enter with Package
Control: Install Package.
- Search for “SML (Standard ML)” and press enter to install.
- To use SML highlighting, you may now navigate to View >
Syntax > SML.
Emacs
If you have Linux, you
almost certainly have emacs installed. For Mac and Windows get:
To install SML syntax highlighting:
- Make a software directory in your home directory
(to do this in the terminal, run mkdir ~/software/).
- Download sml-mode.tar and
unzip it in your software directory (to find it outside
the terminal, your software directory will be in software
in your home directory on a Mac or
in C:\cygwin\users\YOURNAME\software on Windows). This will
create a directory ~/software/sml-mode-3.3-custom.
- Open Emacs, type Control-x Control-f to open a
file, and then edit the line at the bottom of the screen to
Find file: ~/.emacs
and press enter. This is your emacs startup file.
-
Copy the the contents
of dotemacs-win.txt (Windows)
or dotemacs-mac.txt (Mac)
into this file. On Windows, you will need to edit the first line,
replacing YOURNAME with your Cygwin user name. NOTE: The
windows file is untested; let me know if you have problems.
- Save, close, and restart emacs.
- When you open emacs again and open a file.sml, it
will now color the syntax. Also, you can run SML inside emacs as
follows:
- Control-c Control-b: load the current emacs buffer into the SML
repl.
- Control-c Control-s: pop up a separate window with the
SML repl.
Some emacs resources:
- Start with this tutorial
on getting started with emacs
- To exit emacs, type Control-X, then Control-C. A prompt may
appear asking you about saving any changes you made; if this happens,
you will need to answer it before exiting.
- The emacs wiki is the
omnibus resource for emacs usage
- Wikipedia has an
article on the general history and culture of emacs, for the
curious.
LaTeX
For the written assignments, you may wish to use LaTeX.
LaTeX is built from Don Knuth's TeX typesetting language, and has
grown through community support to be both extremely powerful and easy
to use. There are any
number of excellent resources about how to use LaTeX; a few are listed
here for your convenience.
LaTeX source files can be created with any text editor, and emacs and
vim are excellent choices. There are several LaTeX specific IDEs that
you may find more comfortable to use, depending on your working
environment: