VictorTaelin/Interaction-Calculus logo

VictorTaelin/Interaction-Calculus

Free

A programming language and model of computation that matches the optimal λ-calculus reduction algorithm perfectly.

FreeFree tier
Type
Open Source

About VictorTaelin/Interaction-Calculus

The Interaction Calculus (IC) is a minimal term rewriting system inspired by the Lambda Calculus (λC), with key differences that make it inherently more efficient and expressive. Vars are affine (can only occur up to one time) and global (can occur anywhere in the program). It features first-class superpositions and duplications, enabling optimal evaluation that can make some computations exponentially faster. Global lambdas allow expressing concepts not possible in traditional λC, including continuations, linear HOAS, and mutable references. Being fully affine simplifies garbage collection and parallelism. This repository includes a reference implementation in C (with native numbers) and a single-file implementation in Haskell (with a step debugger). The IC is the theoretical foundation for the HVM (Higher-Order Virtual Machine).

Key Features

Minimal term rewriting system inspired by the Lambda Calculus
Affine variables (occur at most once) and global variables
First-class superpositions and duplications for optimal evaluation
Global lambdas enabling continuations, linear HOAS, and mutable references
Efficient garbage collector due to affine property
Simplified parallelism
Reference implementation in C with native numbers
Single-file Haskell implementation with step debugger

Pros & Cons

Pros
  • Enables optimal evaluation of λ-calculus, yielding exponential speedups for certain computations
  • Expressive beyond traditional lambda calculus (continuations, linear HOAS, mutable references)
  • Affine typing simplifies garbage collection and parallelism
  • Open-source with reference implementations in C and Haskell
  • Compact formal specification with clear interaction rules

Best For

Research in models of computation and optimal reductionExploring linear logic and term rewriting systemsTeaching and learning advanced lambda calculus conceptsPrototyping programming languages with affine types