Madhavan Mukund



Programming Language Concepts
Jan-Apr 2023

Programming Language Concepts

January-April, 2023


Administrative details

  • Instructors: Madhavan Mukund, S P Suresh

  • Teaching Assistants: Aryan Agarwala (aryan), Samiparna Biswas (samiparna), Harish Chandramouleeswaran (harishc)

  • Evaluation:

    • Quizzes (10%), assignments (30%), midsemester exam (20%), final exam (40%)

    • Copying is fatal

  • Textbooks and lecture notes:

    John C Mitchell: Concepts in Programming Languages, Cambridge University Press (2004)

    Michael L Scott: Programming Language Pragmatics, (4th edition), Morgan Kaufmann (2016)

    Alfred V Aho, Monica S Lam, Ravi Sethi, Jeffrey D Ullman: Compilers: Principles, Techniques, and Tools, Pearson (2013)

    Madhavan Mukund: Lecture notes on Programming Language Concepts (2004)

    Madhavan Mukund: Lecture notes on Generic Programming in Java (2006)


Assignments

TBA


Lecture summary

  • Lecture 1, 5 Jan 2023 (Class Notes (pdf), Slides (pdf) )

    • Introduction
    • Program and data refinement
    • Modular software development
    • Object-oriented programming: abstraction, subtyping, dynamic dispatch, inheritance

    Mitchell: Chapter 9 (upto 9.2.2), Chapter 10 (upto 10.2)

  • Lecture 2, 10 Jan 2023 (Class Notes (pdf), Slides (pdf) )

    • Classes and objects: Python examples and the need for public/private modifiers
    • Introduction to Java: compilation, basic datatypes
  • Lecture 3, 12 Jan 2023 (Class Notes (pdf), Slides (pdf) )

    • Introduction to Java: control flow, classes, constructors
  • Lecture 4, 17 Jan 2023 (Slides (pdf) )

    Java: class hierarchy and polymorphism

    • Subclasses and inheritance
    • Dynamic dispatch and runtime polymorphism
    • Java class hierarchy
    • Overriding methods
    • Modifiers: private, static, final
  • Lecture 5, 19 Jan 2023 (Slides (pdf) )

    Abstract classes and interfaces

    • Abstract methods and abstract classes
    • Interfaces and implementations
    • Private classes and nested objects
  • Lecture 6, 24 Jan 2023 (Slides (pdf) )

    Variables, functions, allocation

    • Global variables and static allocation
    • Code segment and data segment
    • Local variables and function parameters
    • Scope and lifetime of variables
    • Function invocations and activation records
    • Call graphs, call stack
  • Lecture 7, 24 Jan 2023 (Slides (pdf) )

    Functions and Call Stack

    • Functions and activation records
    • Call stack
    • Control link and access link
    • Handling function calls and function returns
  • Lecture 8, 2 Fev 2023 (Slides (pdf) )

    Heaps and memory management

    • Heaps and dynamic allocation
    • The need for memory management
    • Explicit memory management and dangling pointers
    • Unreachable nodes and garbage
    • Mark-and-sweep garbage collection
    • Generational garbage collectors
    • Reference counting, reference cycles, weak references
  • Lecture 9, 7 Feb 2023 (Class Notes (pdf), Slides (pdf) )

    Abstract classes and interfaces

    • Interfaces: callbacks, iterators
    • Functional interfaces, lambda expressions
  • Lecture 10, 9 Feb 2023 (Class Notes (pdf), Slides (pdf) )

    • Generics in Java
    • Type inference
  • Lecture 11, 14 Feb 2023 (Class Notes (pdf), Slides (pdf) )

    • Collections, Maps, Exceptions in Java
  • Lecture 12, 16 Feb 2023 (Class Notes (pdf), Slides (pdf) )

    • Reflection, Cloning in Java
  • Lecture 13, 28 Feb 2023 (Class Notes (pdf), Slides (pdf) )

    • Concurrency: Threads, Processes, Race Conditions, Mutual Exclusion
  • Lecture 14, 2 Mar 2023 (Class Notes (pdf), Slides (pdf) )

    • PL support for concurrency: semaphores, monitors
  • Lecture 15, 7 Mar 2023 (Class Notes (pdf), Slides (pdf) )

    • Monitors and threads in Java
  • Lecture 16, 9 Mar 2023 (Class Notes (pdf), Slides (pdf) )

    • Concurrent programming example
    • Thread safe collections
  • Lecture 17, 14 Mar 2023 (Slides (pdf) )

    Introduction to the λ-calculus

    • λ-calculus – syntax
    • Rewriting lambda expressions – β-reduction
    • Encoding numbers – Church numerals
  • Lecture 18, 21 Mar 2023 (Slides (pdf) )

    Encoding arithmetic functions

    • Lambda calculus – brief recap
    • Encoding arithmetic functions – successor, sum, product, exponentiation
    • Introducing a language for computable functions