Programming Language Foundations

Overview


Part overview:

  1. Building a Calculator. introduces a simple prefix arithmetic language called 𝒯.
  2. Theory of Programming Languages. Covers key concepts in programming language theory like type safety. You will learn a bit about unsafe Rust too!
  3. Evaluation and Big Step. This chapter covers big-step evaluation (in 𝒯) as a relation defined by evaluation rules.
  4. Booleans and Conditional Computation. Here we introduce the language , which has booleans and if-then-else expressions. You will also learn to create derived boolean operators using syntax sugar.
  5. Conditional Arithmetic. Merges the arithmetic and boolean languages 𝒯, together in the language 𝒞 and adds comparison operators.
  6. Type Systems and Type Checking. This chapter introduces type checking, the typing relation and its rules. You will make 𝒞 type safe by adding a correct type checker to it.

Dependency Graph

ProgrammingLanguageFoundationsRustBASIC1234567756Dependency Graph of Part 4

Even if the chapters don’t have dependencies between them, it’s still recommended to go through them in the numerical order.

Notably, the material will work with various traits quite a bit, so please recap the content in Generics and Traits if you don’t feel confident with traits.

Programming Languages vs. Computation

Here is a short overview how the theory of programming languages differs from the theory of computation:

Theory of Programming LanguagesTheory of Computation
FocusStructure, meaning and behavior of programming languages and programsFundamental limits and capabilities of computation
Common questions”What does this program mean?”, “Is this optimization correct?""What can be computed?”, “How efficient can an algorithm be?”
Models of computationTyped lambda calculi, abstract machinesAutomata, turing machines, untyped lambda calculus, circuits
Properties studiedType safety, termination, effectsDecidability, computability, complexity classes, reductions
Practical impactBetter language design, better static analysis, safer languages, correct compilersClassification of problems, impossibility results, complexity bounds