McMaster University
CAS 706

Lectures  Extra material  Languages and compilers  Assignements Presentations

Lectures

Tuesday, Thursday 1:00-2:30 in ITB/222.

I have used (part of) the following set of slides:

Textbooks and web materials

Programming Languages: Principles and Paradigms Allen Tucker and Robert Noonan.
Types and Programming Languages Benjamin C. Pierce
There is some very useful material at the following pages: When in the mood to look at weird languages, I definitely recommend 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: All the sites above contain executables and lots of documentation.

Assignments

Lambda calculus interpreter

Presentations

Domain Theory (pdf)
semantics of arrays & pointers (ppt)

Some questions on “Semantics of Arrays & Semantics of pointers” presentation:

  1. What are three categories of memory and what are their usages?
  2. Two sets (Environment and Memory) are used to manage memory, explain how their elements are produced and changed.
  3. What part(s) of memory are used, when a program requests (allocates) some bytes of memory with a pointer to it?
  4. What part(s) of memory are used, when a program requests (allocates) an array?
  5. Explain ‘new’ and ’allocate’ functions, when a program request memory for an array.
  6. Why do we change relation from t->t’ to t|mu -> t’|mu’ (mu and mu’ are the starting and ending states of memory), when we are explaining operational semantics of pointer-evaluation?

Basic OO (pdf)
  1. What are the differences between subtyping and inheritance? What links them together?
  2. Clearly explain the advantages of using prototyping over classical object-oriented programming? Give an example of a prototype based language?
  3. Explain why traits is a more flexible solution compared to the other common forms of inheritance (ie. single, multiple, interfaces, and mixins).
  4. Explain the following OO principle “We aim for Strong Cohesion and weak coupling”. In your explanation include examples to be clear.

OO - overloading, overridding, etc (pdf)
AOP (ppt)
  1. What are the benefits that AOP adds to OOP? What are the potential drawbacks?
  2. Describe the following AOP constructs: aspect, advice, join point, pointcut, introduction.
  3. What is an aspect? What are the differences and similarities between aspects and classes?

Compiling functional languages (pdf)
  1. Define and contrast the push/enter and eval/apply models of compiling higher-order functions.
  2. Describe a way of handling polymorphism (when compiling a functional language). What are the advantages/disadvantages?
  3. What is a thunk, how can it be represented, and what does "updating" mean?
  4. How are heap objects represented in the Spinelass Tagless G (STG) Machine? What are the advantages/disadvantages of this design choice?
  5. Describe the informal operational semantics of "let" and "case" in the STG language.

Additional resources

Lectures 0-5 (see bottom of page for links) are very useful and topical. The slides from this course on programming languages are also topical.

Googling for "introduction to lambda calculus" and "lambda calculus interpreter" yield a lot of useful resources



Jan 2005