/lambda

Compiler for a super-simple lambda calculus-based language.

Primary LanguageHaskellGNU General Public License v3.0GPL-3.0

Lambda

This is a demo compiler for a super-simple functional expression language based on the lambda calculus. It's very limited, and is meant as a jumping-off point for further language-based experiments and projects.

This is a useful demo project showing how Alex (Haskell-based lexer) and Happy (Haskell-based parser) can work together.

Running the compiler

You must have GHC and cabal installed in order to build and run the compiler. You can build the compiler by running the following at the command line, in the same directory as this repository:

cabal sandbox init
cabal install alex happy # cabal doesn't automatically install build tools
cabal install --only-dependencies
cabal build lambda-compiler

You can run the compiler on the example file provided with:

cabal run --verbose=0 lambda-compiler < examples/Example.lambda | runhaskell