▶️ How to build a compiler with LLVM and MLIR - 09 IR (SLIR) generation
In this episode I talked about the basics of IR generation in MLIR and how we define the SLIR dialect using ODS and tablegen and a few operations to keep things simple.
In this episode I talked about the basics of IR generation in MLIR and how we define the SLIR dialect using ODS and tablegen and a few operations to keep things simple.
In this episode I talked about the MLIR and some llvm basics that we need to know before we can jump into the Serene compiler again and generate the IR.
Resources:
In this episode I talked about the Serene context, the namespace and the Environment concepts in our compiler that we had to skip in the previous episode.
In this episode we start our journey through the semantic analysis phase of the Serene compiler. We talk about the remaining node types and the workflow of the semantic analyzer including the tree rewriting process.
In this episode we go over the basic implementation of the Serene lang's AST. We start from some basic theory and move to common node types.
In this episode we go over the parser implementation of the Serene lang and how to parse the source code of our programming language to create an abstract syntax tree (AST).
Parser Algorithm:
Parser generators:
In this Episode I talked about compilers, LLVM and MLIR and why we use them in the Serene compiler. Just a high level overview, enough to help us understand the basics and get started.
Resources:
In this episode of how to build a compiler with LLVM and MLIR tutorial series, we're going through some basic steps to get started with Serene. Including a brief intro to the requirements and the LLVM and Serene's build system and how to build and install LLVM, MLIR.
If you encounter any issues that I can help with, you can use either IRC or Matrix to connect with me, so I can help you as much as I can.
IMPORTANT NOTE: I've moved the Serene's repository to https://git.sr.ht/~lxsameer/Serene, Please make sure to pull down the correct branch since the code has changes drastically. Reach out if you need any help.
The first episode of a tutorial series on how to design and build a compiler with LLVM and MLIR. If you want to build a programming language, this tutorial is the right material for you.
In this series, we're going to build a real lisp compiler called Serene. It will be a looooong journey.
If you encounter any issues that I can help with, you can use either IRC or Matrix to connect with me, so I can help you as much as I can.