Skip to content

i3abghany/kyoto

Repository files navigation

Kyoto logo Kyoto

This is the repository for the Kyoto Programming Language and its compiler, Cyoto. Kyoto is a statically typed, compiled language that is still in early design stages. The compiler is written in C++ and utilizes LLVM for analysis and code generation.

Building

Cyoto requires the following dependencies:

  • LLVM >= 20
  • CMake >= 3.20
  • Java >= 8
  • antlr == 4.13.2
  • Boost >= 1.74.0
  • GCC >= 11 (for C++23 support)

To install the dependencies on Ubuntu, run the following commands:

$ sudo apt-get install llvm-20-dev cmake default-jre libboost-all-dev gcc-11 g++-11 libfmt-dev libzstd-dev

Antlr 4.13.2 can be installed from the official website's mirror as follows:

$ wget https://www.antlr.org/download/antlr-4.13.2-complete.jar -O /path/to/install
$ chmod +x /path/to/install/antlr-4.13.2-complete.jar
$ export PATH="/path/to/install:$PATH"

If llvm-20 is not available in the package manager, it can be installed using the script provided on the official website as follows:

$ wget https://apt.llvm.org/llvm.sh
$ chmod +x llvm.sh
$ sudo ./llvm.sh 20 all

To build the compiler, run the following commands:

$ mkdir build
$ cd build
$ cmake ..
$ make cyoto -j$(nproc)

Usage

To compile a Kyoto source file, run the following command:

$ ./cyoto --help

Usage: ./cyoto [OPTIONS] INPUT_FILE
The Kyoto Programming Language Compiler:
  -h [ --help ]                 Print this help message
  -r [ --run ]                  Run the program in `lli` after compilation
  -o [ --output ] arg (=out.ll) Output file for the LLVM IR

Fuzzing the Compiler

This repository includes a grammar-based fuzzer for the Cyoto compiler, which is based on the ANTLR4 grammar for Kyoto defined in kyoto/grammar/. The fuzzer is written in Rust. For more information on how to use it, refer to the README in the fuzzer directory.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

The Kyoto Programming Language and its compiler & fuzzer, Cyoto

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published