Haskell Kaleidoscope Tutorial http://www.stephendiehl.com/llvm
This is an open source project, patches and corrections always welcome.
Install the dependencies:
$ cabal sandbox init
If you just want to compile the examples then configure with the following command. Ensure that
llvm-config
is on your $PATH
.
$ cabal configure
If you want to build the tutorial text locally configure with the following. This will install pandoc from source which will take a while.
$ cabal configure --flags=tutorial
Then install the dependencies:
$ cabal install --only-dependencies
The source code for the example compiler of each chapter is included in
the /src
folder. With the dependencies installed these can be built
using the Makefile at the root level.
$ make chapter1
$ make chapter6
To generate the HTML page:
$ make tutorial.html
A standalone PDF can also be generated with:
$ make tutorial.pdf
LLVM + MIT License