C++ Implementations of programming languages and type systems studied in "Types and Programming Languages" by Benjamin C. Pierce..
Implementations of programming languages and type systems studied in Types and Programming Languages.
Each subdirectory implements one of the languages studied in the book. Each such implementation consists of a lexer, parser, interpreter, and type system for the language implemented.
Each implementation contains 3 files:
Language | Directory | Status |
---|---|---|
Untyped Arithmetic Expressions | ch04_arith | ![]() ![]() ![]() |
The Untyped Lmabda Calculus | ch07_untyped | ![]() ![]() ![]() |
Typed Arithmetic Expressions | ch08_tyarith | ![]() ![]() ![]() |
Simply Typed Lambda Calculus | ch10_simplebool | ![]() ![]() ![]() ![]() |
Typed Lambda Calculus (with various extensions) | ch11_fullsimple | Natural numbers (Nat) type support :heavycheckmark: Lexer + Tests ![]() ![]() __Records and Projections ![]() ![]() ![]() |
Typed Lambda Calculus with Subtyping | ch17_rcdjoinsub | ![]() ![]() ![]() |
Typed Lambda Calculus with Imperative Objects | ch18_fullref Example Programs |
Let bindings support :heavycheckmark: Lexer + Tests :heavycheckmark: Parser + Tests :heavycheckmark: Interpreter + Tests __References (Ref, Source, Sink) ![]() ![]() ![]() __Sequencing ![]() ![]() ![]() __Recursion ![]() ![]() ![]() |
cd ch##_<lang>
clang++ --std=c++17 test.cpp && ./a.out
cd ch##_<lang>
clang++ --std=c++17 interpreter.cpp && ./a.out "input program"