Comparative Programming Languages
.
Instructor: Greg Baker. Office hours: Wednesdays 12:00–13:00 and Fridays 10:00–11:00 in CSIL (ASB 9840).
TAs: see the course home page for details.
Course web page: in CourSys https://coursys.sfu.ca/2025su-cmpt-383-d1/pages/.
Lecture slides: https://ggbaker.ca/prog-langs/.
Lectures in-person. Audio recordings provided (best-effort: technical problems happen).
Whoever you are, I'm glad you're here.
My big goals for the course:
Functional programming.
Programming language features.
Safe programming, ownership, and concurrency.
safeprograms (and
safein what sense)?
Where the marks come from:
Late penalty: 20%/day.
There will be a short exercise due most Fridays: ten in total. Designed to reinforce basic ideas and force you to practice the concepts.
See CourSys for exact dates.
There will be one larger assignment for each major section of the course:
All in-person on paper.
Midterm exam: 10% in week 8, Wed July 2 in lecture time.
Final exam: 40%, as scheduled by Student Services.
Some optional books/references if you want them:
I'll add additional links to the course web site and/or lecture slides as appropriate.
To get credit for this course, I expect you to demonstrate that you know how to apply a variety of programming language concepts. That means:
Failure to do these may result in failing the course.
That rule isn't intended to fail someone just because they get 49% on the exams: it will be applied on an individual basis with a judgement call on the question has this student has demonstrated that they understand the basic concepts of the course?
Academic Honesty: it's important, as always.
If you're using an online source, leave a comment.
def this_function(p1, p2): # adapted from http://stackoverflow.com/a/21623206/1236542 ...
If you work with another student, we shouldn't be able to tell from the results.
More details on course web site.
You are expected to do the work in this course yourself (or as a group for the project). Whenever you submit any work at the University, you're implicitly certifying this is my own independent work
.
I take academic dishonesty seriously and penalties will reflect that.
Examples of things that are not okay and will be treated as academic dishonesty:
The quizzes are regular tests: individual work, closed book.
I will be asking for a grade of FD in the course for any academic dishonesty on quizzes.
We're going to be looking at programming differently that you're (probably) used to, so we'll have to rethink our basic definitions too.
An old definition I used in CMPT 120:
An algorithm is an unambiguous sequence of instructions for solving a problem. A program is a description of an algorithm that a computer can understand.
i.e. a program is a sequence of instructions
.
Consider this instruction
in some programming language:
total = values.sum()
How is .sum()
evaluated? Right to left? Left to right? In parallel on many cores?
There are many details of that instruction
that we didn't really specify. We left them to the language/library to figure out.
Some languages don't specify a sequence of steps. One you might be familiar with:
SELECT users.last_name, orders.date FROM users INNER JOIN orders ON user_id WHERE orders.date > today()
How does the database get you the results? You don't know (because it depends at least on the way the tables are indexed).
We will see more examples of languages that don't specify steps explicitly (in case you don't think SQL counts as programming
).
We are going to have to adjust our understanding of what a program
is.
The old
definition of programming was probably a good definition of imperative programming.
In an imperative program, the programmer gives an explicit series of steps that must be followed in order; variables represent the current state and are manipulated directly by the programmer.
e.g. C/C++, Java, C#, Python, JavaScript, …
But there's more to the world of programming. Previously-held assumptions that we'll see aren't always true:
In this course, we will explore some non-imperative languages. Declarative languages let you describe the results you want, but not the exact sequence of steps required to get there.
Examples of declarative (non-programming?) languages:
There is not a totally clear line between imperative and declarative languages.
That is, a programmer can often do declarative-like things in imperative
languages, and vice-versa.