McMaster University
CAS 706
Lectures
Extra material
Languages and compilers
Assignements
Presentations
Tuesday 12:30-13:20 in ITB/222, and Friday 10:30-12:20 in ITB/AB105.
Evaluation
40% assignments, 35% in-class presentation, 25% final exam.
Assignments
- Parametrized quicksort.
Languages: D, Eiffel, Ocaml, Prolog.
- Lambda calculus interpreter.
Languages: Lua, Scala, Haskell, mercury.
- Typed Lambda calculus interpreter.
Languages: Pascal, Javascript, F#, curry.
- Fun with scripting languages. Perl, python.
- Bonus: implement the AO Challenge in MetaOCaml, where
each ``aspect'' should be modularized, in the same style as the
modularization for the Gaussian Elimination family. See also
this paper.
Required: Types and Programming Languages Benjamin C. Pierce
A good idea: Programming Languages: Principles and Paradigms Allen Tucker and Robert Noonan.
There is some very useful material at the following pages:
When in the mood to look at weird languages, I definitely recommend
In the same vein, some good jokes based on programming languages.
I recently found a nice comparison of the
extension benefits of OO vs functional. Clearly lays out the tradeoffs involved.
I could also talk about how FP is (mostly) based on initial algebras and OO on
co-algebras, but that might not enlighten many amongst you!
For specific languages, I recommend:
- Smalltalk
- GNU Prolog
- Prolog tutorial
- Use gcc for C code. Turn on all warnings.
- Haskell. I recommend using Hugs for learning Haskell.
- Ocaml. Note that ocaml 3.04 is
installed on the CAS servers (in /usr/local/bin); this is fine for
getting the assignments done. The latest version of ocaml is 3.07+2,
but it is not necessary to use this.
- Java. Java 1.4 is already
installed on all CAS machines.
- You can use either free pascal
or use one of the undergraduates machine with Pascal installed on it.
- mercury.
This is now installed on birkohff (a Sun) and penguin (linux). To
run this properly you should
- add /usr/local/mercury-0.11.0/bin to your PATH,
This can be done (if you use a csh-based shell) via
putting
set path = ($path /usr/local/mercury-0.11.0/bin)
in your .cshrc (in your home directory). Something similar can
be put in your configuration
if you use a sh-based shell.
- add /usr/local/mercury-0.11.0/man to your MANPATH,
- and add /usr/local/mercury-0.11.0/info to your INFOPATH.
- You may also want to add the following lines to the `.emacs' file in your home directory (if you are an emacs user):
(setq load-path (cons (expand-file-name
"/usr/local/mercury-0.11.0/lib/mercury/elisp") load-path))
(autoload 'mdb "gud" "Invoke the Mercury debugger" t)
All the sites above contain executables and lots of documentation.
Presentations
Topics to choose from (* items need to be covered):
- * TAPL Ch 9,11 (typed lambda calculus + extensions)
- * TAPL Ch 12,13 (normalization, references)
- * TAPL Ch 15,16 (subtyping)
- * TAPL Ch 19 (featherweight Java)
- * TAPL Ch 22 (type reconstruction - needed for assignment 3)
- TAPL Ch 23 (Universal types)
- TAPL Ch 24 (Existential types, modules)
- * OO: objects, classes, inheritance, subtyping, prototypes
- * OO: overloading, overriding and method dispatch
- Domain Theory (CPOs, least and greatest fixed points, etc)
- Meta-programming
- Compiling statically typed functional languages
- Compiling dynamically typed languages
- Continuations and semantics of goto
- Partial evaluation
- Operational semantics of Prolog
- suggest a topic!
Additional resources
Googling for "introduction to lambda calculus" and
"lambda calculus interpreter" yield a lot of useful resources
Dec 2007