Donato is a custom programming language developed as part of my master's thesis, which I completed at the University of Twente in the Netherlands and presented at the University of Parma, where I am currently enrolled.
This language has been built completely from scratch using C++. The core components include a parser and an Abstract Syntax Tree (AST). Each node of the AST class implements specific code generation functions that produce LLVM intermediate representation (IR), enabling the language to be compiled into native executable code via the LLVM infrastructure.
By leveraging LLVM, Donato benefits from a modern and powerful backend, allowing for efficient code generation and optimization. This compilation pipeline ensures that source code written in Donato can be transformed into highly optimized machine code.
To build and run the Donato compiler on a Linux system, follow these steps:
- Clone the repository:
git clone https://github.com/sasyxk/donato.git cd donato - Install dependencies
sudo apt update sudo apt install clang llvm-dev
- Create a build directory and compile the compiler:
mkdir build cd build cmake .. make
To compile a .donato source file:
-
Place your source file (e.g., example.donato) inside the build directory or anywhere you prefer.
-
Run the compiler with:
./dtc example.donato
-
The compiler will generate a default executable named output.
./output
Note: In future versions, you will be able to specify the output executable's name via command-line options.
Donato is designed as a compiled language to explore modern compiler design techniques. Writing the compiler from scratch allowed me to deeply understand parsing, AST construction, and code generation using LLVM. This project serves both as a research and educational tool for compiler technology.