• Stars
    star
    116
  • Rank 303,894 (Top 6 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

sage

Proteomics search & quantification so fast that it feels like magic
Rust
107
star
2

microlisp

A set of minimal lisp implementations
C
57
star
3

axum-aws-lambda

Example of using Axum with AWS Lambda
Rust
31
star
4

lass

An x86 assembler that you probably shouldn't use
C
20
star
5

Gemini

C# Library for Gemini Cryptocurrency Exchange API
C#
12
star
6

Libra

The open source user interface for the Gemini Exchange
C#
9
star
7

ext2-boot

Open source ext2/ELF32 bootloader
C
9
star
8

rosalind

Rosalind bioinformatics exercises in Rust http://rosalind.info
Rust
8
star
9

ext2util

Command line utility for writing and reading files for ext2 images
C
6
star
10

rust-kmeans

K-means clustering in rust
Rust
5
star
11

dbscan

Dependency free implementation of DBSCAN clustering in Rust
Rust
4
star
12

simd-euclidean

Calculation of euclidean distance between vectors, with SIMD
Rust
3
star
13

deface

Lightweight markup language
Rust
3
star
14

trainmuck

A fast and simple optimizing brainfuck compiler
Standard ML
2
star
15

rust-backend-example

HTML
2
star
16

ini

A lightweight configuration file parser
C
2
star
17

census

High performance Rust library for parsing, filtering, and manipulating multiplexed proteomics data
Rust
2
star
18

crispr

Rust library for designing sgRNAs for genome engineering using CRISPR/Cas9
Rust
1
star
19

assembly

Projects and examples in x86_64 assembly
Assembly
1
star
20

mz_parquet

Rust
1
star
21

bf

Rust
1
star
22

osdev64

Operating System for x86_64 architecture
C
1
star
23

peer-discovery

Rust
1
star
24

census2csv

Convert TMT multiplexed proteomics data in the Census format to CSV files
Rust
1
star