DreamBerdC
First compiler using LLVM, why not make it perfect?

Link

https://github.com/SleepySwords/DreamBerdc

Description

Tried to implement a basic version of the meme language Dreamberd to learn more about how compilation occurs. This was written in the Rust programming language.

Experiences

  • Learnt how to implement a lexer and a parser in Rust to form the abstract syntax tree using this as a reference.
  • Learnt more in depth about how basic control flows, such as if, for and while loops are constructed.
  • Learnt how to use the library inkwell and LLVM to be able to generate asm code from the abstract syntax tree.

Todos

  • Implement a way to combine basic data types into more complex data types.
  • Learn more about programming language theory.
  • Try to implement my own codegen to gain further experience in how the asm is actually created, for example: how registers are selected to do operations.

Tools used

Rust
A nice to use programming language with emphesis on ownership and memory safety
LLVM
A compiler framework that helps to build languages for many different platforms.