A toy compiler handwritten in a weird subset of C++.
The language is a staticly typed, low-level systems programming language. It is compiled to an internal IR, then LLVM is used to generate native machine code.
The compiler currently requires clang for compiling the runtime/bootstrap code and lld for linking.
The compiler also includes a profiler (for the compiler itself) that can be enabled with the -DPROFILING=Yes
option given to CMake.
The profiler trace logs are viewable with speedscope. The profiler currently only works on Windows and x86.
- Install LLVM 11 or higher (including clang and lld)
- Install CMake 3.21 or higher
- Install target development depndencies
- (Windows) Install the Windows SDK (Only tested on Windows 10)
- (Linux) No development libraries are needed
- (Emscripten) Install the Emscripten SDK
- Clone repository
git clone https://github.com/yaram/simple-compiler.git cd simple-compiler
- Run CMake configuration
mkdir build cd build cmake ..
- Run build
cmake --build . --target compiler