15312 Foundations Of Programming Languages -
Here's a sample implementation in Haskell:
You stop learning languages based on syntax. When a new language emerges, you evaluate it based on its type system, evaluation strategy, and memory model, allowing you to master it in days rather than months.
– Define what can be proven about a program using logical assertions (preconditions and postconditions). Example: x = n x := x + 1 x = n + 1
Every programming language consists of two distinct layers: how it looks (syntax) and what it means (semantics). Concrete vs. Abstract Syntax
The cornerstone of 15-312 is the concept of . A type-safe language guarantees that well-typed programs will not "go wrong" or exhibit undefined behavior at runtime. Type safety is proved mathematically using the standard framework established by Robin Milner and formalized by Robert Harper via two fundamental theorems: 1. Progress 15312 foundations of programming languages
15-312 is notoriously rigorous. It requires a shift from "trial-and-error" programming to a "think-first" mathematical approach. The assignments often involve implementing complex language features in a functional language like Standard ML (SML), forcing students to grapple with high-level abstractions. Conclusion
Using the Lambda Calculus as a base, we explore how functions act as first-class citizens and how System F allows for "generic" programming through type variables.
Checks type errors at compile-time (e.g., Java, Rust).
`inferType :: Expr -> TypeScheme`
At its heart, 15312 is a course in and Operational Semantics . It moves away from the "black box" approach of using a compiler and instead teaches students how to build a language from the ground up using mathematical logic.
This is the heart of the course. You will learn to define typing rules using (horizontal lines).
: Typically requires proficiency in Standard ML (SML) and experience with writing formal proofs. Taking 15-212 (Principles of Programming) is a standard prerequisite.
The "Dynamics" describe how a program steps from one state to the next. Using , you write rules that dictate exactly how an expression evaluates. This is where you learn about: Here's a sample implementation in Haskell: You stop
This is not a "learn to code in Python" course; it is a "learn how and why programming languages work" course. It deals with type theory, logic, and the mathematical structure of computation.
Week 1: Lambda calculus, ASTs, evaluation rules, write an interpreter. Week 2: Simply typed lambda calculus, typing rules, implement type checker. Week 3: Hindley–Milner basics, unification, start implementing Algorithm W. Week 4: Progress & preservation proofs for core language. Week 5: Polymorphism/System F overview, CPS conversion. Week 6: Effects and moduless, final project polishing and write-up.
Static semantics dictate what constitutes a "legal" program before execution. This is where type systems are defined. Using formal derivation rules (logical fractions), students learn to prove that an expression has a type under a specific context Γcap gamma (written as
The birth of procedural languages like FORTRAN, which, according to the IEEE Computer Society , remains relevant in scientific computing today. Example: x = n x := x +
The foundations of programming languages are the grammar, logic, and mathematics of computation itself. And once you learn them, every language becomes a dialect of a single, universal tongue—the language of thought made formal.
To reason about state, 15312 introduces :