#lambda-calculus #lambda #calculus #repl #cli #parser

bin+lib lambda_calc

A command-line untyped lambda calculus interpreter

7 stable releases

2.2.2 Jun 15, 2020
2.2.1 Jun 13, 2020
2.1.0 May 5, 2020
2.0.0 Feb 29, 2020
1.0.1 Oct 19, 2019

#9 in #lambda-calculus

MIT license

125KB
3K SLoC

An untyped lambda calculus interpreter.

It has several useful features:

  • Has support for the usual implicit parenthesization rules of lambda calculus

    • See the documentation for the parse function on here).
  • Highlights the expression reduced last at each beta reduction step

    • (Can be disabled.)
  • Allows bind lambda terms to symbols (definitions)

    • Lazy symbol substitution

    • Allows recursive definitions

  • Has context-sensitive TAB completion, matching brace highlighter, and history support (thanks to rustyline).

  • Allows escaping line breaks with &

    • The line will be saved to history as a single line.
  • Has a non-interactive mode whose output is in a can be easily parsed by scripts

  • Allows counting the number of reduction steps

...along with many other features; run with --help for more.

Screenshots

Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4

Installation

Install cargo if you don't have it, then run

$ cargo install lambda_calc

This will install the lambda_calc binary. Opitonally, you may use the --root option to install to a different directory; run man cargo-install for details.

Dependencies

~5.5MB
~101K SLoC