This project aims to implement a compiler/interpreter of the KOAK language, a simplified version of the original Kaleidoscope Language (which can be found here), using haskell language and llvm. This project is divided in 4 parts:
- Parsing
- Building the AST
- Inferring Types
- Code Compilation
Once the program reads the files containing the documentation written in KOAK it will identify all of its components, such as: literals(integer, double, string, etc), binary operators (+,-,*,/,etc), variables, functions, calls, etc...
Once the parsing is done, the parser will build an abstact syntax tree that will map all the components in order.
Once the tree is built, inferring will get all the elements from the tree and attribute their types.
Once all the previous steps are completed, the tree will be sent to the code generation which will compile it and create a binary using llvm bindings.
You will need to install Stack, Clang and Llvm
$> git clone https://github.com/Erecutoro/KOAK.git
$> make
$> make tests_run (for unit tests)
$> ./koak files