Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.28 KB

README.md

File metadata and controls

38 lines (24 loc) · 1.28 KB

Compiler

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.

How to run

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.

ToDo List

  • 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