Welcome to CMPT 383, Fall 2019!¶
Welcome to CMPT 383: comparative programming languages. In this course we’ll be comparing and contrasting a number of programming languages, including Racket, Haskell, and Go.
The course marking scheme, along with weights and due dates for assignments, quizzes, etc. are on Canvas.
Here is the official course outline. Please note a couple of things:
The exact list of topics is not quite accurate on the outline, and instead we will be following the topics listed below.
The following grading rule will be applied at the end of the course:
Students must attain an overall passing grade on the weighted average of exams in the course in order to obtain a clear pass (C- or better).
Please be aware of the marking rules we will be following during the course, including what this course considers ethical, and unethical, behavior. Read these rules — ignore them at your peril!
Assignments¶
The course marking scheme, along with weights and due dates for assignments, quizzes, etc. are on Canvas.
Midterm exam¶
Closed-book, in-class during a regular lecture time. Please note that you will be asked to place all books, jackets, computers, cell phones, etc. at the side of the room.
The exam will only cover topics up to the end of Racket. Nothing about Haskell will be asked.
Some basic exam rules that will be followed:
- You cannot leave in the first 30 minutes (in order to give people who arrive late a chance to write the exam).
- In the last 10 minutes of the exam, no one can leave. This is to avoid disturbing people who are still working on the exam.
Importantly, you may not have a cell phone with you when you write the exam. You must put your cell phone in your bag, or keep it at the front of the room.
There will not be time during the midterm to allow people to use the washroom, so please be prepared!
The date of the exam is in Canvas.
The exam could have any type of questions, such as:
- Reading or writing code.
- Defining important terms, or giving examples of them.
- Short answer, true/false, multiple choice, etc.
This is not necessarily an exhaustive list. There could be other types of questions, and not all these questions types will necessarily occur on the exam.
Here is the
Fall 2019 midterm exam
(solutions
). Note that this exam is based on Racket.Here is a
sample midterm exam
(solutions
). Note that this exam is based on Scheme.Here is
the Summer 2019 CMPT 383 midterm exam
(solutions
). Note that this exam is based on Scheme.
Please read the grading FAQ for answers to commonly asked question about how grades are calculated.
Final exam¶
Closed-book, at a time set by SFU during exam schedule. Please note that you will be asked to place all books, jackets, computers, cell phones, etc. at the side of the room.
Some basic exam rules that will be followed:
- You cannot leave in the first 30 minutes (in order to give people who arrive late a chance to write the exam).
- In the last 10 minutes of the exam, no one can leave. This is to avoid disturbing people who are still working on the exam.
Importantly, you may not have a cell phone with you when you write the exam. You must put your cell phone in your bag, or keep it at the front of the room.
Please read the grading FAQ for answers to commonly asked question about how grades are calculated.
Here’s some info about the final exam:
- You will have 2 hours to write the exam.
- Please bring a pencil and eraser (and a pen, if you like).
- There’s 1 Racket question, 2 Haskell questions, and 2 Go questions (each question is divided into smaller parts).
- Functional programming was a major theme of the course, so make sure you can implement and use higher-order functions such as map, filter, and fold.
Software¶
Assignments for this course will use a number of languages, and so here are some suggestions about how to use those languages:
Racket: Download the most recent version from https://download.racket-lang.org/. Note that it comes with a visual IDE called DrRacket that you should be able to use for all assignments in this course. You can use it on Windows or Linux.
Haskell: I use this in Linux, and recommend you do the same. On Ubuntu Linux you can install everything you need from the command-line by typing this:
$ sudo apt-get update $ sudo apt install haskell-platform
Make sure to use a recent version of Haskell, as older versions lack some features we will be using.
If you don’t want to use Linux, it might be okay to use a Windows or online version of Haskell. It is your responsibility to make sure the you are using a version of Haskell compatible with the one I am using in Linux.
You can install Ubuntu Linux using a virtual machine (such as Virtual Box) on your computer. If you are unfamiliar with the Linux shell, here are a few basic Linux shell commands.
Go: I use this in Linux, and recommend you do the same. On Ubuntu Linux you can install everything you need from the command-line by typing this:
$ sudo apt-get update $ sudo apt install golang-go
If you would like a more recent version of Go then check here for instructions on adding a more up-to-date Go archive.
Course Notes¶
Notes will be posted here as the course progresses.
- Racket
- Haskell
- Introduction to Haskell
- Functions
- Testing with QuickCheck
- A nice video with the creator of QuickCheck showing how it can be used to find a serious bug.
- Basic user-defined types
- Laziness, Infinity, and Strictness
- Application and Composition
- Folding
- Impure Programming in Haskell
- Go