002 // projects
MiniLang
MiniLang is a from-scratch compiler for a small imperative programming language, built to understand compiler theory and low-level systems programming from first principles rather than treating them as black boxes. It includes a hand-written lexer and recursive-descent parser that produces an abstract syntax tree, a type checker that catches type mismatches and undefined-variable errors at compile time, and a static analysis pass modeled on patterns from tools like Clang-Tidy that detects use-before-initialization, unreachable code, and integer overflow risks. Execution runs through a stack-based bytecode interpreter, extended with an experimental LLVM IR backend to explore native code generation. The project is backed by 100+ unit tests written with GoogleTest covering parsing edge cases, type errors, and interpreter correctness, with a CMake build and GitHub Actions CI ensuring every commit is automatically tested. Throughout development, design trade-offs (such as recursive-descent versus table-driven parsing) were documented to make the architectural reasoning explicit, not just the outcome.