Ergawy Types And Programming Languages Save

C++ Implementations of programming languages and type systems studied in "Types and Programming Languages" by Benjamin C. Pierce..

Project README

Types and Programming Languages

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.

Directory Structure

Each implementation contains 3 files:

  • interpreter.hpp: This is the main part containing the actual implementation of the language.
  • interpreter.cpp: This file contains a simple main() method to invoke the interpreter. For now, it only accepts a single command line argument consisting of the program to be evaluated.
  • test.cpp: Contains tests for the separate components of an interpreter: lexer, parser, and interpreter.

Status

Language Directory Status
Untyped Arithmetic Expressions ch04_arith :heavy_check_mark: Lexer + Tests
:heavy_check_mark: Parser + Tests
:heavy_check_mark: Interpreter + Tests
The Untyped Lmabda Calculus ch07_untyped :heavy_check_mark: Lexer + Tests
:heavy_check_mark: Parser + Tests
:heavy_check_mark: Interpreter + Tests
Typed Arithmetic Expressions ch08_tyarith :heavy_check_mark: Lexer + Tests
:heavy_check_mark: Parser + Tests
:heavy_check_mark: Interpreter & Type Checker + Tests
Simply Typed Lambda Calculus ch10_simplebool :heavy_check_mark: Lexer + Tests
:heavy_check_mark: Parser + Tests
:heavy_check_mark: Type Checker + Tests
:heavy_check_mark: Interpreter + Tests
Typed Lambda Calculus (with various extensions) ch11_fullsimple Natural numbers (Nat) type support
:heavy_check_mark: Lexer + Tests
:heavy_check_mark: Parser + Tests
:heavy_check_mark: Type Checker + Tests
Records and Projections
:heavy_check_mark: Lexer + Tests
:heavy_check_mark: Parser + Tests
:heavy_check_mark: Type Checker + Tests
Typed Lambda Calculus with Subtyping ch17_rcdjoinsub :heavy_check_mark: Lexer + Tests
:heavy_check_mark: Parser + Tests
:heavy_check_mark: Interpreter + Tests
Typed Lambda Calculus with Imperative Objects ch18_fullref
Example Programs
Let bindings support
:heavy_check_mark: Lexer + Tests
:heavy_check_mark: Parser + Tests
:heavy_check_mark: Interpreter + Tests
References (Ref, Source, Sink)
:heavy_check_mark: Lexer + Tests
:heavy_check_mark: Parser + Tests
:heavy_check_mark: Interpreter + Tests
Sequencing
:heavy_check_mark: Lexer + Tests
:heavy_check_mark: Parser + Tests
:heavy_check_mark: Interpreter + Tests
Recursion
:heavy_check_mark: Lexer + Tests
:heavy_check_mark: Parser + Tests
:heavy_check_mark: Interpreter + Tests

Usage

Running Tests

cd ch##_<lang>
clang++ --std=c++17 test.cpp && ./a.out

Interpreter

cd ch##_<lang>
clang++ --std=c++17 interpreter.cpp && ./a.out "input program"
Open Source Agenda is not affiliated with "Ergawy Types And Programming Languages" Project. README Source: ergawy/types-and-programming-languages
Stars
34
Open Issues
0
Last Commit
3 years ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating