Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hydrogen602/compiler

Trying to make a language and compiler
https://github.com/hydrogen602/compiler

Last synced: about 2 months ago
JSON representation

Trying to make a language and compiler

Awesome Lists containing this project

README

        

# 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
```bash
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