This project attempts to create a custom language and a compiler for it that generates LLVM IR.
A few examples of the language can be found in fib.idk
, fibR.idk
, test.idk
, and test.old.idk
.
This project used to be focused on generating MIPS code, but now I've transitioned to trying to use LLVM to simplify things.
Currently the language features functions, recursion, if, else, and while statements. The only type currently supported is integers.
See comparison/README.md
for speed comparisons. Currently it looks to be 35% slower than C.
Run make build
to compile the compiler.
Run
cabal run compiler -- -i fibR.idk
to compile the fibR.idk
. Then execute ./a.out
to run the compiled code.
- Enums on the heap
- Reference counting incrementing
- Emit llvm instructions for incr/decr reference counts - function calls are slow
- Make performance tests for benchmarking against C and past/future versions