Welcome to the repo for the Aburiscript (pronounced Eh-bree-script) compiler. Aburiscript is a C and C++ frontend that currently outputs LLVM IR and is designed to support standard C features, various extensions (like blocks and attributes), and a growing subset of C++ features including classes, polymorphism, templates, and exceptions.
Aburiscript can currently compile many of the world’s top C projects, including chibcc, OpenSSL, Git, SQLite, PostgreSQL, FFmpeg/librempeg, gstreamer, libplacebo, mpv, QEMU, Ghostscript, zlib, and zstd. It can also compile and run many compiler test suites such as the GCC torture suite.
The project is still very much in development, and a compiler backend implementation is planned soon (which would remove LLVM as a hard dependency) along with many other features (more info in Future plans).
The name of the project comes from the town of Aburi, Ghana and its botanical garden.
More information can be found at the Aburiscript home page and in the documentation in this repo.
For a short path from build to first executable, including runnable example
programs under sample_c/ and sample_cpp/, see the
Quick Start Guide.
- CMake 4.1 or higher
- LLVM 18.x (configured via
LLVMConfig.cmake). I developed with 18.1.8 and don't know if lower or higher versions of LLVM 18 will change behavior. - A C++20 compatible host compiler
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR=/path/to/llvm-18/lib/cmake/llvm
cmake --build buildIf you prefer llvm-config, use the one that belongs to LLVM 18, or pass
-DCMAKE_PREFIX_PATH=/path/to/llvm-18 instead. See the
Build and Dependency Guide for the supported LLVM policy and
release packaging guidance.
The default configure path builds the compiler only. To enable the public
runtime smoke suite under public_tests/, add
-DABURI_BUILD_PUBLIC_TESTS=ON.
The public runtime smoke suite is driven by CTest. Once configured with
-DABURI_BUILD_PUBLIC_TESTS=ON, run:
ctest -R public_tests_runtimeThis check compiles and runs each sample in public_tests/.
- Standard control flow and operators.
- Pointers, arrays, and Variable Length Arrays (VLAs).
- Structs, unions, and bitfields.
- Enums.
- Variadic functions.
- GCC/Clang extensions like
__attribute__((packed)),__builtin_offsetof, etc. - Apple Blocks (
^). - C11 features like
_Static_assert,_Alignas, and_Thread_local. - C99
_Complexand compound literals.
- Classes and structs with access control.
- Member functions (methods), constructors, and destructors.
- Single and multiple inheritance with virtual methods (polymorphism).
- Pointers to members.
- Exceptions (
try,catch,throw). - Dynamic allocation (
new,delete). - Templates (partial support).
- CLI Usage Guide: Learn how to use compiler flags and compilation modes.
- Quick Start Guide: Build
aburiand compile the sample C and C++ programs. - Build and Dependency Guide: Configure LLVM correctly for source and release builds.
- Architecture: Learn about the internal stages of the compiler.
- C Features: Detailed breakdown of supported C features.
- C++ Features: Detailed breakdown of supported C++ features.
- Real-World Validation: See which major open-source projects Aburiscript can compile.
- C++ "Most Vexing Parse": How the compiler resolves C++ declaration ambiguities.
- Compiler Glossary: Definitions for compiler-specific terminology used in the codebase.
- Debugging Playbook: Guide for debugging parser, semantic, and codegen issues.
- Contributing: Guidelines for contributing to the compiler.
- Future plans: What's next for the project.
Aburiscript is dual-licensed under either the Apache License, Version 2.0 or the MIT License, at your option. See LICENSE, LICENSE-APACHE, and LICENSE-MIT.