All Projects → ergawy → types-and-programming-languages

ergawy / types-and-programming-languages

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

Programming Languages

C++
36643 projects - #6 most used programming language
ocaml
1615 projects

Projects that are alternatives of or similar to types-and-programming-languages

tiny-lang
tiny-lang — A different programming language. Supports a bunch of spoken languages.
Stars: ✭ 26 (-18.75%)
Mutual labels:  interpreter, compilers, interpreters
ciforth
A generic system for creating i86 implementations of the language Forth.
Stars: ✭ 38 (+18.75%)
Mutual labels:  interpreter, compilers
aria
Expressive, noiseless, interpreted, toy programming language
Stars: ✭ 40 (+25%)
Mutual labels:  interpreter, lexer
pascal-interpreter
A simple interpreter for a large subset of Pascal language written for educational purposes
Stars: ✭ 21 (-34.37%)
Mutual labels:  interpreter, lexer
fayrant-lang
Simple, interpreted, dynamically-typed programming language
Stars: ✭ 30 (-6.25%)
Mutual labels:  interpreter, lexer
malluscript
A simple,gentle,humble scripting language for mallus, based on malayalam memes.
Stars: ✭ 112 (+250%)
Mutual labels:  interpreter, lexer
3bc-lang
Low level language, tiny virtual machine that works on computers and microcontrollers. (Friendly Punched cards)
Stars: ✭ 155 (+384.38%)
Mutual labels:  interpreter, compilers
Libfsm
DFA regular expression library & friends
Stars: ✭ 512 (+1500%)
Mutual labels:  lexer, compilers
Mico
Mico ("Monkey" in catalan). Monkey language implementation done with C++. https://interpreterbook.com/
Stars: ✭ 19 (-40.62%)
Mutual labels:  interpreter, lexer
Rs Monkey Lang
Monkey Programming Language written in Rust.
Stars: ✭ 80 (+150%)
Mutual labels:  interpreter, lexer
Lioness
The Lioness Programming Language
Stars: ✭ 155 (+384.38%)
Mutual labels:  interpreter, lexer
Cub
The Cub Programming Language
Stars: ✭ 198 (+518.75%)
Mutual labels:  interpreter, lexer
Own-Programming-Language-Tutorial
Репозиторий курса "Как создать свой язык программирования"
Stars: ✭ 95 (+196.88%)
Mutual labels:  interpreter, lexer
MonkeyLang.jl
"Writing an Interpreter in GO" and "Writing a Compiler in GO" in Julia.
Stars: ✭ 30 (-6.25%)
Mutual labels:  interpreter, lexer
monkey
The Monkey Programming Language & Interpreter written in PHP.
Stars: ✭ 21 (-34.37%)
Mutual labels:  interpreter, lexer
awesome-internals
A curated list of awesome resources and learning materials in the field of X internals
Stars: ✭ 78 (+143.75%)
Mutual labels:  interpreter, compilers
lua-in-rust
The Lua programming language, implemented in Rust.
Stars: ✭ 76 (+137.5%)
Mutual labels:  compilers, interpreters
kolasu
Kotlin Language Support – AST Library
Stars: ✭ 45 (+40.63%)
Mutual labels:  compilers, interpreters
Swiftpascalinterpreter
Simple Swift interpreter for the Pascal language inspired by the Let’s Build A Simple Interpreter article series.
Stars: ✭ 270 (+743.75%)
Mutual labels:  interpreter, lexer
Monkey Rust
An interpreter for the Monkey programming language written in Rust
Stars: ✭ 174 (+443.75%)
Mutual labels:  interpreter, lexer

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 ✔️ Lexer + Tests
✔️ Parser + Tests
✔️ Interpreter + Tests
The Untyped Lmabda Calculus ch07_untyped ✔️ Lexer + Tests
✔️ Parser + Tests
✔️ Interpreter + Tests
Typed Arithmetic Expressions ch08_tyarith ✔️ Lexer + Tests
✔️ Parser + Tests
✔️ Interpreter & Type Checker + Tests
Simply Typed Lambda Calculus ch10_simplebool ✔️ Lexer + Tests
✔️ Parser + Tests
✔️ Type Checker + Tests
✔️ Interpreter + Tests
Typed Lambda Calculus (with various extensions) ch11_fullsimple Natural numbers (Nat) type support
✔️ Lexer + Tests
✔️ Parser + Tests
✔️ Type Checker + Tests
Records and Projections
✔️ Lexer + Tests
✔️ Parser + Tests
✔️ Type Checker + Tests
Typed Lambda Calculus with Subtyping ch17_rcdjoinsub ✔️ Lexer + Tests
✔️ Parser + Tests
✔️ Interpreter + Tests
Typed Lambda Calculus with Imperative Objects ch18_fullref
Example Programs
Let bindings support
✔️ Lexer + Tests
✔️ Parser + Tests
✔️ Interpreter + Tests
References (Ref, Source, Sink)
✔️ Lexer + Tests
✔️ Parser + Tests
✔️ Interpreter + Tests
Sequencing
✔️ Lexer + Tests
✔️ Parser + Tests
✔️ Interpreter + Tests
Recursion
✔️ Lexer + Tests
✔️ Parser + Tests
✔️ 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"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].