Skip to content

serjective/aburiscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Aburiscript C/C++ Compiler

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.

Quick Start

For a short path from build to first executable, including runnable example programs under sample_c/ and sample_cpp/, see the Quick Start Guide.

Prerequisites

  • 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

Building from Source

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR=/path/to/llvm-18/lib/cmake/llvm
cmake --build build

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

Running Tests

The public runtime smoke suite is driven by CTest. Once configured with -DABURI_BUILD_PUBLIC_TESTS=ON, run:

ctest -R public_tests_runtime

This check compiles and runs each sample in public_tests/.

Features Overview

C Support

  • 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 _Complex and compound literals.

C++ Support (In Progress)

  • 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).

Documentation

License

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.

Packages

 
 
 

Languages