Skip to content

w4z3d/compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

174 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c0 Compiler

A C0 compiler built in C++ with no external dependencies.

C0 is a safe subset of C designed for teaching. It features garbage-collected heap allocation, bounds-checked arrays, and contracts, while retaining C like expression syntax and control flow.

Features

Building

Clang is strongly recommended. The codebase uses C++23 features that may not be fully supported by other compilers.

# Clone
git clone https://github.com/w4z3d/compiler.git
cd compiler

# Build with CMake and Ninja
mkdir build && cd build
cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -G Ninja ..
cmake --build .

Usage

./compiler examples/test.c0 <output>

References

  • M. Braun, S. Buchwald, S. Hack, R. Leißa, C. Mallon, A. Zwinkau. Simple and Efficient Construction of Static Single Assignment Form. CC 2013.
  • S. Hack, D. Grund, G. Goos. Register Allocation for Programs in SSA Form. CC 2006.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages