Giter Site home page Giter Site logo

yibit / types-and-programming-languages Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lazear/types-and-programming-languages

0.0 0.0 1.0 581 KB

Exercises from Benjamin Pierce's "Types and Programming Languages" textbook + extras!

License: MIT License

Rust 100.00%

types-and-programming-languages's Introduction

types-and-programming-languages

Several Rust implementations of exercises from Benjamin Pierce's "Types and Programming Languages" are organized into different folders, as described below:

  • arith is an implementation of the untyped lambda calculus extended with simple numeric operations

  • lambda is an implementation of the untyped lambda calculus as presented in chapter 5, 6, and 7.

  • typedarith is the arith project extended with simple types: Nat and Bool

  • stlc is an implementation of the simply typed lambda calculus, as discussed in chapters 9 and 10 of TAPL. This simply typed calculus has the types, Unit, Nat, Bool, T -> T (arrow), and Record types.

  • recon contains several implementations of Hindley-Milner based type reconstruction from the untyped lambda calculus to System F, with let-polymorphism. Both Algorithm W (the more common) and Algorithm J (the more efficient) are presented. For Alg. W, both a naive equality constraint solver, and a faster union-find (with path compression) solver are provided. Algorithm J makes use shared mutable references to promote type sharing instead.

  • system_f contains a parser, typechecker, and evaluator for the simply typed lambda calculus with parametric polymorphism (System F). The implementation of System F is the most complete so far, and I've tried to write a parser, typechecker and diagnostic system that can given meaningful messages

  • system_fw contains a parser for a high-level, Standard ML like source language that is desugared into an HIR, and then System F-omega. This extends system_f with type operators and higher-kinded types. This is where most of the ongoing work is located, as I'd like to make this the basis of a toy (but powerful, and useable) programming language. Ideally we will have some form of bidirectional type inference. Work on this has accidentally turned into a full fledged SML compiler, so it's likely that I will roll back the work on the system_fw project to just type checking

  • bidir is is an implementation of the bidirectional typechecker from 'Complete and Easy Bidirectional Typechecking', extended with booleans, product, and sum types. I make no claims on the correctness of the implementation for the extended features not present in the paper.

  • dependent is WIP, implementing a simple, dependently typed lambda calculus as discussed in ATAPL.

types-and-programming-languages's People

Contributors

lazear avatar

Forkers

ocaml-lang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.