← All repos

calculus-of-constructions

Minimal, fast, robust implementation of the Calculus of Constructions on JavaScript.

Browse cluster: Cluster 73
5commits
2contributors
1languages

Tech stack & purpose

Calculus of Constructions is a lightweight JavaScript implementation of the Calculus of Constructions, a minimalistic programming language and constructive mathematical foundation that underpins proof assistants like Coq. The project provides both a command-line interface and JavaScript API for parsing, type-checking, and evaluating terms in this language, supporting core features like lambda abstractions, universal quantification, function application, recursive fixed points, and let bindings. Built entirely in ES5-compliant JavaScript using higher-order abstract syntax for efficiency, the implementation achieves remarkable compactness at under 400 lines of code and 2.3kb gzipped, while offering a robust parser, smart stringifier for displaying combinators, and support for auto-importing undefined variables from files.

Community & reference links

Languages

JavaScript
100.0%

Contributors