Skip to content
Snippets Groups Projects

λ++

λ++, or Lambda Plus Plus, is small abstraction layer on top of normal lambda calculus. This project consists of a transpiler to turn λ++ into BLC (binary lambda calculus). This can then be run with a normal BLC interpreter, such as Justine's.

Language

$false=λtf.f; # definition
$omega=λa. (a a); # definition

λa.a($omega(λbcde.d(bb)(λf.fce)))$false; # main expression (which uses our definitions)

Basically:

  • We have comments, yay
  • Definitions can be used to abstract things (okay this is a pretty loose definition of abstraction)
  • There should be a single expression somewhere, unrelated to the definitions (this is the main expression)

And that's all you get.

Examples

These were all pretty much stolen from Justine's site. Sorry, I'm afraid I don't know what I'm doing.

$ cargo run -- examples/hello_world.lpp | ./blc
Hello World!
$ { cargo run --release -- examples/sort.lpp; echo; printf "sort this is string please"; } | ./blc
    aeeghiiilnoprrsssssttt
{ cargo run -- examples/reverse.lpp; echo; printf "hello world"; } | ./blc
dlrow olleh