Home

Awesome

Lambda Calculus Development Toolkit

This repo is a collection of tools for writing programs in lambda calculus and SKI combinator calculus, written by various authors.

This repo is designed and intended to be used as a dependency manager for projects related to lambda calculus programming.

This repo includes tools and interpreters for the following lambda-calculus-based languages:

Dependency Graph

Lambda calculus language dependency graph

Supported Interpreters and Tools

Interpreters

Tools

Other Tools

Not included in this repo, but related to lambda calculus programming:

Lambda Calculus Interpreter Details

Below is a summary of the supported lambda calculus interpreters. Each interpreter uses a slightly different I/O encoding, classified below as languages.

LanguageExtensionEngineProgram Format
Binary Lambda Calculus*.blcUntyped Lambda CalculusBinary (asc2bin can be used)
Bitwise Binary Lambda Calculus*.blc, *.bitblcUntyped Lambda CalculusASCII
Universal Lambda*.ulambUntyped Lambda CalculusBinary (asc2bin can be used)
Lazy K*.lazySKI Combinator CalculusASCII
InterpreterLanguagePlatformsBuild CommandAuthorNotes
BlcBinary Lambda Calculusx86-64-Linuxmake blc@jart521-byte interpreter
trompBinary Lambda CalculusAnymake tromp@trompIOCCC 2012 "Most functional" - the source is in the shape of a λ
uniBinary Lambda CalculusAnymake uni@trompUnobfuscated version of tromp
uni++Binary Lambda CalculusAnymake uni++@melvinzhangFast binary lambda calculus interpreter written in C++, featuring many speed and memory optimizations. A rewrite of uni. Originally named uni
UniObfBitwise Binary Lambda CalculusAnymake UniObf@trompFeatures optimizations included in uni++. Written in obfuscated-style Haskell
clambUniversal LambdaAnymake clamb@iroriFast UL interpreter
lazykLazy KAnymake lazyk@iroriFast Lazy K interpreter

Building the Interpreters and Tools

To build all interpreters:

make blc tromp uni uni++ UniObf clamb lazyk

Several notes about the interpreters:

To build all tools:

make asc2bin lam2bin blc-ait

Building tromp on a Mac

Mac has gcc installed by default or via Xcode Command Line Tools. However, gcc is actually installed as an alias to clang, which is a different compiler that doesn't compile tromp. This is confirmable by running gcc --version. On my Mac, running it shows:

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

A workaround for this is to use uni instead, which is an unobfuscated version of tromp compilable with clang. To build tromp, first install gcc via Homebrew:

brew install gcc

Currently, this should install the command gcc-11. After installing gcc, check the command it has installed.

Then, edit the Makefile's CC configuration:

- CC=cc
+ CC=gcc-11

Then, running

make tromp

will compile tromp.

Usage

Please see the "Running LambdaLisp" section in my other project LambdaLisp for details.