Veridise-Partnerships / aleo2llvm

[Mirror] A compiler for Aleo -> LLVM IR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aleo2llvm

aleo2llvm is a lightweight LLVM frontend compiling Aleo instructions to LLVM IR. It's built upon Aleo's snarkVM.

Building and Installing

To build aleo2llvm and install a command-line shotcut to it, run the following command:

cargo install --path .

Usage

You can directly call aleo2llvm from command-line:

aleo2llvm <DIR_OF_ALEO_PROJ>

where <DIR_OF_ALEO_PROJ> points to the root folder of your Aleo project.

For example:

aleo2llvm ./test/toy-examples/adder/

This outputs two files:

  • A *.ll file of the transpiled LLVM IRs.
  • A *.json file of a summary that provides detailed metadata/info of the target Aleo project, e.g., types and mapping of variables. The summary file will be useful for downstream tasks that depend on LLVM IR, e.g., a static analyzer, symbolic execution, etc.

Alternatively, to do a quick testing without installation, just do:

cargo run <DIR_OF_ALEO_PROJ>

For example:

cargo run ./test/toy-examples/adder/

About

[Mirror] A compiler for Aleo -> LLVM IR

License:GNU General Public License v3.0


Languages

Language:LLVM 46.1%Language:Rust 30.1%Language:Shell 23.8%