cyclang-parser 0.1.20

Cyclang is a toy language built in LLVM.
Documentation
  • Coverage
  • 1.15%
    1 out of 87 items documented0 out of 3 items with examples
  • Size
  • Source code size: 47.76 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.92 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 22s Average build duration of successful builds.
  • all releases: 22s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • lyledean1/cyclang
    21 2 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • lyledean1

Cyclang

A programming language I built in Rust - mainly for fun and my own learning! Uses PEG Parser in Rust for parsing and LLVM (llvm-sys) as the backend to compile to machine code binary. Check the user guide for a detailed overview of the language.

Try the Fibonacci example in /examples/fib.cyc

fn fib(i32 n) -> i32 {
    if (n < 2) {
        return n;
    }
    return fib(n - 1) + fib(n - 2);
}
print(fib(20));

You will need Rust installed to run the below command.

cyclang --file ./examples/fib.cyc

This should output 6765!

Installing and Running

You will need LLVM 19 installed before you install cyclang,

For MacOS run the following command

brew install llvm@19

For Ubuntu install the following packages

  llvm-19 
  llvm-19-tools 
  llvm-19-dev 
  clang-19 
  libpolly-19-dev

And run make set-llvm-sys-ffi-workaround

Then the easiest way to install the binary currently is through the Rust package manager Cargo - see Install Rust. Once the step above is done, then run

cargo install cyclang

See the book for a more detailed guide on setup.