CM20214/CM20221: Advanced Programming Principles
End of Unit
These units have now been retired. Their content will be found
in other units, such as CM20252 Artificial intelligence;
CM20253 Comparative Programming Languages;
CM20256 Functional programming; and others
Running Lisp
Here
are some basic instructions on how to run Lisp on the BUCS lcpu
machines
A very
quick introduction
to Lisp
Unit Catalogue
CM20214
CM20221
Some texts
Books on Functional Languages
Lisp has been about since 1957, so there's been plenty of books written, some
of them good. The only thing to bear in mind is that each book tends to be
written for a particular variety of Lisp, so the details might vary.
Books I like include
- "The Little Lisper" Friedman and Felleisen
- "The Little Schemer" Friedman and Felleisen
- "Structure and Interpretation of Computer Programs" Abelson and
Sussman. Probably ought to be read by all Computer Scientists whether they are
interested in Lisp or
not. (Video lectures)
- "Object-Oriented Programming: The CLOS Approach" Paepcke
- "The Art of the Metaobject Protocol" Kiczales et al
Books on Algorithms
Again, very many texts out there. It's mostly a matter of personal choice of a
book that suits you.
- "Understanding Algorithms and Datastructures" Brunskill and
Turner. Uses C and Ada
- "Algorithms in C" Sedgewick
- "Analysis of Algorithms and Data Structures" Banachowski,
Kreczmar and Rytter. For the mathematical
- "Introduction to the Design and Analysis of Algorithms"
Levitin. Looks OK
- "Data Structures, Algorithms & Software Principles in C"
Standish.
The dedicated follower should read all volumes of "The Art of Computer
Programming" by Knuth.
Some links
-
Relative popularity
of various languages in the real world
- C is more subtle than you think. Try
this Quiz about integers in
C
- Functional
Programming on Wikipedia
- List
of functional languages
- Functional Programming
For The Rest of Us from a Java perspective
- History
of Lisp by John McCarthy
- History
of Lisp by Herbert Stoyan
- The Evolution
of Lisp by Steele and Gabriel
- Common Lisp
- Practical Common Lisp
online book
- R6RS Scheme
- MIT
Scheme
- Structure
and Interpretation of Computer Programs full text
- Structure
and Interpretation of Computer Programs Video Lectures by Hal Abelson
and Gerald Jay Sussman
- EuLisp
- ISLisp
- Euscheme,
a EuLisp implementation
- EuScheme
Notes
- Some EuLisp
implementations (2011)
- Xlisp, a Scheme
implementation
- Clisp, a Common Lisp implementation
- Common
Lisp Specification
- Clojure a Lisp that runs on top of the
Java virtual
machine; WikiBook.
Clojure has many gratuitous
syntactic differences with other Lisps
and several semantic differences as a consequence of using the JVM
- Hyperpolyglot comparison
of Common Lisp, Scheme, Clojure and Emacs Lisp
- Haddocks' Eyes, with
some
explanation
- The Funarg
problem
- Technical
Issues of Separation in Function Cells and Value Cells Lisp-1 vs Lisp-2
- Boehm garbage
collector for C and C++. This contains several links to GC literature
- Visualizing Garbage Collection Algorithms
- Glasgow Haskell Compiler;
ghc and ghci interactive r-e-p loop
- Wikibook on Haskell
- Learn You a Haskell for
Great Good!
- Scala
an OO
functional language that uses the Java virtual machine
- Curry-Howard
Isomorphism
- Erlang Practical functional
- Rust A post-C language
- Go A post-C language
- Lua Scripting, procedural, functional,
bytecode
- OCaml Functional (and imperative and OO)
- Glib reference
manual
- List of
common algorithms
- List of
string matching algorithms
- C Right-Left
Rule for deciphering C declarations
- The C Object System: Using C as a
High-Level Object-Oriented Language
- Compiler
error messages from the Apple MPW C compiler
- Ten
Things I Hate About Object-Oriented Programming
- C++ as a
Multiparadigm Language including reflections on why OO is not a
panacea
- Go and Rust - objects without
class
- Resource Acquisition Is
Initialization (RAII)
- Clever
Algorithms Nature-Inspired Programming Recipes
- A
Brief, Incomplete, and Mostly Wrong History of Programming Languages
- Valgrind
- AddressSanitizer
a fast memory error detector (currently only using Clang)
- Banks
will stick with COBOL because Java has performance issues
- What
Every Computer Scientist Should Know About Floating-Point Arithmetic
- Facebook's
New Spam-Killer Hints at the Future of Coding
using Haskell
- Rosetta Code
solutions to tasks in many languages
- Use after free
and dangling pointers
- The
worst mistake of computer science about how NULL is a big problem
Wikipedia articles tend to be fairly accurate in this area.
Running Lisp and Haskell
Several Lisps are available on the BUCS machines lcpu
Scheme
~masrjb/bin/xlisp
Xlisp is a Scheme
Euscheme
~masrjb/bin/euscheme
Euscheme is a EuLisp.
Notes
on using Euscheme.
CLisp
~masrjb/bin/clisp
This is GNU Common Lisp
Clojure
~masrjb/bin/clojure
This is a Lisp that runs on top of the Java VM. There are a lot of differences
between this and other Lisps
Haskell
~masrjb/bin/hugs
Most of the above are open source and may well run on other operating systems.
As Year 2 Students you should have no trouble finding the sources and
getting them to run.
There is even a repository of
EuLisp implementations. A version of EuScheme, renamed EuXlisp, is provided.
Lisp Exercises
Some introductory
exercises.
99
Lisp problems (for the keen student).
Online Past Papers
This Unit was previously called "Programming II"
Past
papers
The CM20221 exam content is identical.
This is a relatively new course that combines elements from several previous
courses:
- CM20029/COMP0029: Applications IV: compilers
- CM10138/COMP0138: Systems II: programming & C
- CM20167/COMP0167: Programming III: functional programming
- CM20168/COMP0168: Programming Languages IV
- C7: Programming in Lisp
- Math0071: Applications of Logic
Coursework
Coursework accounts for 40% of the unit total.
There are two assignments; one in semester 1 and the second in semester 2.
CM20214 The first coursework will be worth 10% and the second
20%. Another 10% will come from part of the Integrative Project.
CM20221 Each coursework will be worth 20%.
Coursework 1 for CM20221 will be larger than that for CM20214.
The Exam
At the end of Semester 2 (60%).
Slides
These will be released after the relevant lecture: there is no
substitute to having the material go through your brain at least once!
Note that these slides are hints to me as to what topics I should cover: they
don't contain everything I shall say in lectures. You should come to lectures,
take notes in lectures and read books.
The file numbers don't correspond to anything in particular in terms of
lectures or subject covered. I may have skipped some material in lectures: why
not improve your general education and read the extra too! The exam will only be
set on material covered in lectures.
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
50
51
52
53
54
55
56
57