A lambda calculus interpeter
LCI is an interpreter for the lambda calculus. It supports many advanced features such as recursion, user-defined operators and multiple evaluation strategies, all based on the pure calculus. It is free software licenced under the GNU General Public Licence (GPL).
LCI is a command line program, but it can also run in a browser via WebAssembly. Try it below or open the fullpage demo.
LCI can be considered a small (but powerfull) functional progamming language based on the pure lambda-calculus. Its features include:
0, Succ, Pred, IsZero
..lcirc
..lcirc
and are available by default.[a,b,c]
is parsed as a:b:c:Nil
(:
and Nil
are defined in .lcirc
).let x = M in N
is parsed as (\x.N) M
.[a,b,c]
notation..lcirc
).All features are implemented in the pure lambda calculus.
To demonstrate them, there is an implementation of the N-Queens problem
(queens.lci
) in a way that reminds of Haskell syntax.
The latest version is available here. To install extract the archive, cd to that directory and run:
cmake -B build
cd build && make
sudo make install
This will install the lci
executable in /usr/local/bin
and .lcirc, queens.lci
in
/usr/local/share/lci
. You can install then in a different location by passing
-DCMAKE_INSTALL_PREFIX=<dir>
to cmake
.
You can also checkout the code from github.
Install Homebrew and run:
brew install lci
Windows binaries are
available here.
Simply extract and run the lci
executable.
The browser version can be built with emscripten.
You first need to build make_dparser
with a normal build, then build
again with emcmake
. The build is created under build/html/dist
.
mkdir build && cd build
cmake ..
make make_dparser
rm CMakeCache.txt
emcmake cmake ..
emmake make
LCI’s documentation covers most of the program’s features and related lambda-calculus concepts.
If you found a bug please report it. Also feel free to send pull requests, or suggest features.