This project follows the official LLVM Kaleidoscope Tutorial,
a step-by-step guide to implementing a simple functional programming language.
It aims to explore the fundamentals of compiler frontends using LLVM in C++.
Chapter # | Topic | Note (KOR) | Code |
---|---|---|---|
1 | Implementing a Lexer (tokenization) | Note | Code |
2 | Building AST + Recursive Parser | Note | Code |
3 | Generating LLVM IR | Note | Code |
4 | Adding JIT and Optimizer | Note | Code |
5 | Extending Language : Control Flow | Code | |
6 | Extending Language : User-defined Operators | ||
7 | Extending Language : Mutable Variables | ||
8 | Compiling to Object Code | ||
9 | Adding Debug Information |
kaleidoscope_tutorial/
├── src/ # Source files (varying versions according to progress of chapters)
│ └── no_llvm.cpp # Chapter 1 & 2
│ └── llvm_codgen.cpp # Chapter 3
│ └── llvm_opt_jit.cpp # Chapter 4
├── build/ # Build directory (CMake outputs)
├── notes/ # Markdown notes per chapter (written in Korean)
├── includes/
│ └── KaleidoscoprJIT.h # headerfile for custom JIT
├── CMakeLists.txt # CMake configuration
├── LICENSE # MIT License
└── README.md # Project overview
brew install llvm
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
cd kaleidoscope_tutorial
mkdir build && cd build
cmake ..
make
./kaleidoscope