quintenbons / zpp-compiler

1 stars 0 forks source link

Z++: The C++ Compiler Project from Zero

Welcome to Z++, a custom C++ compiler project built from scratch

Getting Started Quickly

./build.sh  # Build the Z++ compiler
./cmake-build/bin/z++ ./cpp_testbase/simple.cpp  # Compile a simple C++ program

Dependencies

sudo apt install nasm
sudo apt install libboost-all-dev
sudo apt-get install cmake

Development Setup

Setting up your development environment is straightforward and enables you to launch programs with a sub-version of the standard library compiled by z++.

source ./setenv.sh                  # Will update your PATH, and add zpp_* commands
zpp_commands                        # List of available commands
zpp_build -c                        # Compile the Z++ compiler
z++ ./cpp_testbase/simple.cpp       # Use Z++ to compile a C++ program

Additional Development Tools

Z++ also provides tools for working with assembly language:

zpp_assemble_binary ./asm_testbase/simple.asm       # Compile an assembly file
zpp_run_nasm ./asm_testbase/simple.asm              # Execute the compiled assembly code

Tests

Z++ has a regression test framework that depends on python 3.10, poetry and pytest

pip install poetry # install poetry
zpp_test_cpp # launch tests
zpp_test_cpp_debug # launch tests (more verbose)