Concepts of Programming Languages
- Casper Poulsen
- Eelco Visser
- Ali Al-Kaswan
- Yana Angelova
- Wesley Baartman
- Kirti Biharie
- Philippos Boon Alexaki
- Luc Everse
- Boris Janssen
- Rembrandt Klazinga
- Mirco Kroon
- Chris Lemaire
- Sterre Lutz
- Yaniv Oren
- Wouter Polet
- Thijs Raijmakers
- Jim van Vliet
- Yoshi van den Akker
- Paul van der Stel
- Eric van der Toorn
The design of a programming language is the result of a selection from a general collection of programming language concepts. With some frequency, new languages are introduced that combine concepts in a novel manner and sometimes introduce new concepts. During their careers, computer scientists will have to work with more than one generation of programming language. In order to learn new programming languages, a computer scientist should understand the basic principles in the design of programming languages. In this course we study these principles.
The topics covered in the course include:
Syntax and interpretation: programs as data, abstract vs. concrete syntax, interpretation
Functional programming: higher-order functions, lexical scope, function closures, currying and partial application, functions over data (especially map, fold, and filter).
Mutation and memory: implementing loops and recursion, tail calls, heap memory allocation and reuse.
Lazy evaluation and infinite streams: lazy vs. eager evaluation, thunks, streams, memoization.
Types: a type as a set of values together with a set of operations, primitive types, compound types, type safety and errors caused by inconsistent use of values, association of types to names, type checking, type inference.
Objects and encapsulation: privacy and visibility of class members, interfaces revealing only method signatures, inheritance, subtyping.
By the end of this course, you will be able to:
Use algebraic data types and pattern matching to implement a definitional interpreter for a programming language concept.
Use a modern high-level programming language such as Scala to implement, test, and debug definitional interpreters and type checkers for languages with simple types.
Define example and counter-example programs that use a programming language concept correctly and incorrectly; for example, variables and lexical scope in a program using function closures.
For multiple programming languages, identify program properties checked statically and program properties checked dynamically.
Discuss how programming concepts interact with the definition and implementation of other language features.
Describe trade-offs of the functional approach (defining a function for each operation with the function body providing a case for each data variant) and the object-oriented approach (defining a class for each data variant with the class definition providing a method for each operation).