Skip to content

This project is a step-by-step implementation of a simple functional language based on the LLVM Kaleidoscope Tutorial.

License

Notifications You must be signed in to change notification settings

minseoc03/llvm-kaleidoscope-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔧 Kaleidoscope Tutorial (LLVM-Based Language Implementation Practice)

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++.


📚 Progress Overview

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

📁 Project Structure

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

🚀 Build & Run (macOS + LLVM via Homebrew)

1. Install LLVM

brew install llvm

2. Add LLVM to your PATH

export PATH="/opt/homebrew/opt/llvm/bin:$PATH"

3. Build and run the project

cd kaleidoscope_tutorial
mkdir build && cd build
cmake ..
make
./kaleidoscope

📄 References

About

This project is a step-by-step implementation of a simple functional language based on the LLVM Kaleidoscope Tutorial.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published