UWA Logo Computer Science & Software Engineering
Programming Paradigms (CITS3242)
   Faculty Home  |  School Home  |  help3242

Handbook Entry

This unit explores and compares the main alternative paradigms for high-level programming. It considers important modern paradigms such as functional programming, logic programming and concurrent programming, and compares these with the mainstream paradigms of imperative programming and object-oriented programming. It considers past and future trends in programming paradigms and explores the motivation for each paradigm, the concepts which define it, and how each paradigm can be used in practice to complete programming tasks. It also compares the advantages of each paradigm in the software production process, with particular emphasis on productivity, scalability, program behaviour, and the correctness of programs. The unit focuses on both fundamental concepts and practical software development, with the former enabling the latter.

Unit information for 2013:

Coordination: Dr. Rowan Davies, rowan.davies@uwa.edu.au
Consultation: Wednesday 1-2pm in CSSE 2.16 (my office, near the labs)
Discussion forum: help3242
Lecture times: Monday 1pm Austin LT and Wednesday 4pm Social Sciences Lecture Room 1
Labs: Tuesday 10-11:25 or 11:25-12:50
choose one (lab time changed due to clashes) in CSSE Lab 2.03 in weeks 2-13.
Language: The F# multi-paradigm language.
Assessment: 40% Project (weeks 7-13, in pairs)
60% Exam, 2 hours

Recommended Text:

You may find the following useful to supplement the lecture notes.
Expert F# 2.0
Expert F# 2.0
Don Syme, Adam Granicz and Antonio Cisternino
Apress 2010

This covers F#, functional programming and some concurrent programming.

The UWA library has one hard copy and electronic access.
(The 2007 edition is very similar, aside from minor changes to F#.)

Web Resources: (updates after the first lab will be highlighted)


If you want to work on the labs on your own computer I recommend that you install Visual Studio 2010 or 2012 Professional or Ultimate edition available from:
  • MSDNAA [it is about 2GB, but you can download it and write it to a DVD or usb drive in the labs, and it won't count towards your quota]
  • Other downloads related to F# are collected HERE including VS2008, stand-alone and non-MSWindows versions.
  • The F# Developer Center includes a link to allow F# development in a browser window, and much more.

If you have problems, ask on the help forum.

Unit schedule:

"EchoSystem" recordings are available for lectures (updated for 2013). (However, these are not intended to be a substitute for lecture attendence - there's strong evidence that students who attend lectures learn more and do better on assessment.)

Topics so far

1. Introduction and Motivation PDF
Part I - Functional Programming
2. Functional Programming - Introduction PDF Reading: Expert F# 2.0 pages 1-12 [2007 edition: 1-12]
3. F# Basics PDF Lab 1: Calendar Sample Solution
Reading: Expert F# 2.0 pages 13-19, 25-33 [2007: 13-19, 27-34]
4. F# Lists PDF Reading: Expert F# 2.0 pages 33-40 [2007: 34-42]
5. Examples and higher-order functions PDF Lab 2 : Index Lab2Index.fs inp inp.index
Sample Solution
6. Polymorphism and Higher-functions PDF Reading: Expert F# 2.0 pages 40-60 [2007: 42-62]
7. Function composition and type definitions PDF Lab 3: Unions and Polymorphism Sample Solution
8. Generic functions, sequences, sets and maps PDF Reading: Expert F# 2.0 pages 60-66 [2007: 62-68]
9. List and sequence functions PDF Lab 4: Universal types and Sequences

NOTE: If Q1 seems hard, try Q2 first.
Sample Solution
Part II - Imperative and Object-Oriented Programming
10. Imperative Programming PDF Reading: Expert F# 2.0 pages 67-96, 117-122 [2007: 69-100, 118-123]
11. Object-oriented programming PDF Lab 5: Imperative Programs/Threads(introduction) Sample Solution         Reading: Expert F# 2.0 chapter 6
Part IV - Advanced Topics (skipping ahead because of relevance to the project)
16. Logic Programming PDF Code: LogicProg.fs
W-Prolog interpreter on the web.
Part III - Concurrent Programming
12. Threads, Locks and Monitors PDF
Lab 6: Threads and Locks
Starting point code Solution: Ask
13. Deadlocks PDF
Reading: Expert F# 2.0 Chapter 13 (for topics 12-15)
14. Asynchronous Computations PDF Project Handout    Starting Point (modified 1pm 10 Sept)     Sample output

You should work in pairs, or alone.
Groups due 5pm Wed Sep 19th
Part 1 is due 4pm Fri 11th October (week 10), part 2 is due 11am Thu 31st Oct (week 13).
Note: each group member should write and submit an individual report for each part.
Check help3242 regularly. (And elect to receive posts by email via the preferences.)
15. Asynchronous Message Passing PDF
Part IV - Advanced Topics
16. Logic Programming PDF Code: LogicProg.fs
W-Prolog interpreter on the web.
17. Logic Programming 2 (Examples) PDF
18. Software Transactional Memory PDF

[Example: bank account PDF]
Beautiful concurrency, a book chapter on STM
STM library for F# - but use this local copy, updated for F# as in VS2010.
(Not allowed for the project though.)
19. Type Inference PDF Type Systems by Luca Cardelli
(Chapter from the CRC Handbook of Computer Science & Engineering)
20. Garbage Collection PDF Myths and Realities: The Performance Impact of Garbage Collection
a research conference paper by Stephen M Blackburn, Perry Cheng and Kathryn S McKinley
21. Lambda-Calculus PDF Evaluator
Sample Exam Sample Answers

Future topics - tentative

The following are from 2012. Any significant modifications will be highlighted.

Top of Page
CRICOS Provider Code: 00126G