PL Introduction 2018
PL Introduction 2018
PL Introduction 2018
Programming Languages
Introduction
Objective
Learning to think about software in this “PL” way will make you a better programmer even
if/when you go back to old ways. It will also give you the mental tools and experience you
need for a lifetime of confidently picking up new languages and ideas.
Tools
SML (Standard Meta Language) by using SML compiler: SML/NJ 110.80
Emacs text editor: emacs 24.5
SML mode for Emacs: sml-mode-6.8.el
Installation Instruction- Windows
Emasc Editor
Download a zip archive of the most recent full version, currently Version 24.5,
available at http://ftp.gnu.org/gnu/emacs/windows/emacs-24.5-bin-i686-
mingw32.zip . (More information and other versions of Emacs are available at the
GNU Emacs website, http://www.gnu.org/software/emacs/.)
Unpack the downloaded zip archive file emacs-24.5-bin-i686-mingw32.zip by
right-clicking it and choosing Extract All. This should produce a folder called
emacs-24.5-bin-i686-mingw32. Move this folder wherever you want, but pick a
permanent place (i.e., do not move it again after the next step).
Once you have moved the folder to where you want, look inside to find
bin\addpm.exe (the .exe extension might not be visible in the folder window
depending on how you have Windows configured). Double click on this file to run
it one time and it should add a Gnu Emacs folder to your Start menu and do some
other setup operations. Open the Start menu and select Gnu Emacs then Emacs (or
just type emacs in the search box) to launch Emacs.
Note:
SML/NJ
Download and run the smlnj.msi installer available at
http://www.smlnj.org/dist/working/110.80/ . This will add an item for SML of New
Jersey to your Start menu and add a command sml that you can use at the command
line.
SML Mode for Emacs Installation
1. Visit http://elpa.gnu.org/packages/sml-mode.html .
2. Locate, and download the latest version (currently sml-mode-6.8.el) from
that page.
3. In Emacs type Alt-x then package-install-file ENTER.
4. At the prompt Package file name: give the path to the just downloaded sml-
mode-6.8.el, and type ENTER.
This will split the window, and show the *Compile-log* with some lines
about Compiling file, and perhaps a warning.
If there are no errors, sml-mode should now be installed.
5. Exit and restart Emacs.
Emacs Basic
Using Emacs feels a little different than using other editors; it can take some getting used
to, especially the keyboard shortcuts. Fortunately, Emacs has buttons and menus to help
you adjust if that is your style. The following is a short primer on Emacs terminology and
keyboard commands.Beyond the basics described here, which should be all you need, there
are countless free resources available. An introductory "tour" is at
http://www.gnu.org/software/emacs/tour/ . For more information, see the Emacs Reference
Manual at http://www.gnu.org/software/emacs/manual/html_node/emacs/index.html (also
available within Emacs from the Help Menu), the Emacs Wiki at
http://www.emacswiki.org/, or the Emacs Tutorial (within Emacs from the Help Menu).