MCPcopy Index your code
hub / github.com/ProvableHQ/leo

github.com/ProvableHQ/leo @leo-fmt-v4.3.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release leo-fmt-v4.3.2 ↗ · + Follow
4,500 symbols 17,286 edges 361 files 1,802 documented · 40%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img alt="leo" width="1412" src="https://github.com/ProvableHQ/leo/raw/leo-fmt-v4.3.2/resources/leo-banner.png">

The Leo Programming Language

<a href="https://crates.io/crates/leo-lang">
    <img src="https://img.shields.io/crates/v/leo-lang?style=flat-square"/>
</a>
<a href="https://circleci.com/gh/ProvableHQ/leo">
    <img src="https://circleci.com/gh/ProvableHQ/leo.svg?style=svg&circle-token=00960191919c40be0774e00ce8f7fa1fcaa20c00">
</a>
<a href="https://discord.gg/aleo">
    <img src="https://img.shields.io/discord/700454073459015690?logo=discord"/>
</a>
<a href="https://twitter.com/ProvableHQ">
    <img src="https://img.shields.io/twitter/follow/ProvableHQ?style=social"/>
</a>

Leo is an imperative, statically-typed programming language built for writing private applications.

Table of Contents

🍎 Overview

Welcome to the Leo programming language.

Leo provides a high-level language that abstracts low-level cryptographic concepts and makes it easy to integrate private applications into your stack. Leo compiles to circuits making zero-knowledge proofs practical.

The syntax of Leo is influenced by traditional programming languages like JavaScript, Scala, and Rust, with a strong emphasis on readability and ease-of-use. Leo offers developers with tools to sanity check circuits including unit tests, integration tests, and console functions.

Leo is one part of a greater ecosystem for building private applications on Aleo. The language is currently in an alpha stage and is subject to breaking changes.

⚙️️ Build Guide

🦀 Install Rust

We recommend installing Rust using rustup. You can install rustup as follows:

  • macOS or Linux: bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

  • Windows (64-bit):

Download the Windows 64-bit executable and follow the on-screen instructions.

  • Windows (32-bit):

Download the Windows 32-bit executable and follow the on-screen instructions.

📦 Download using Cargo

If you don't intend to work on the Leo compiler itself, you can install the latest Leo release with:

cargo install leo-lang leo-fmt leo-lsp

Now to use leo, in your terminal, run:

leo

🐙 Build from Source Code

If you'd like to install the latest unreleased top of tree Leo, you can build from source code as follows:

# Download the source code
git clone https://github.com/ProvableHQ/leo
cd leo

# Install 'leo' and bundled plugins
cargo install --path crates/leo
cargo install --path crates/fmt

🦁 Update from Leo

You can update Leo and its plugins to the latest released version using the following command:

leo update

Note that if you were using a prerelease version of Leo, this will overwrite that with the latest released version.

Now to check the version of leo, in your terminal, run:

leo --version

🚀 Quick Start

Use the Leo CLI to create a new project

# create a new `hello-world` Leo project
leo new helloworld
cd helloworld

# build & setup & prove & verify
leo run main 0u32 1u32

The leo new command creates a new Leo project with a given name.

The leo run command will compile the program into Aleo instructions and run it.

Congratulations! You've just run your first Leo program.

🧰 Troubleshooting

If you are having trouble installing and using Leo, please check out our guide.

If the issue still persists, please open an issue.

📖 Documentation

🤝 Contributing

Please see our guidelines in the developer documentation

🛡️ License

License: GPL v3

🔼 Back to top

Extension points exported contracts — how you extend this code

Command (Interface)
Base trait for the Leo CLI, see methods and their documentation for details. [26 implementers]
crates/leo/src/cli/commands/mod.rs
Pass (Interface)
A compiler pass. Every pass has access to `CompilerState`, and may also specify an `Input` and `Output`. [28 implementers]
crates/passes/src/pass.rs
AstVisitor (Interface)
A Visitor trait for types in the AST. [13 implementers]
crates/ast/src/passes/visitor.rs
FileSource (Interface)
Abstraction over where the compiler reads source files from. The default implementation [`DiskFileSource`] reads from t [5 …
crates/span/src/file_source.rs
PendingRequest (Interface)
One drainable pending request, sufficient to reply on cancellation. [5 implementers]
crates/lsp/src/pending.rs
Emitter (Interface)
Types that are sinks for compiler errors. [2 implementers]
crates/errors/src/emitter/mod.rs
Node (Interface)
A node in a graph. [1 implementers]
crates/passes/src/common/tree_node/mod.rs
UnitVisitor (Interface)
A Visitor trait for a compilation unit (program or library) represented by the AST. [11 implementers]
crates/ast/src/passes/visitor.rs

Core symbols most depended-on inside this repo

map
called by 940
crates/ast/src/lib.rs
expect
called by 710
crates/parser-rowan/src/parser/mod.rs
collect
called by 585
crates/lsp/src/compiler_bridge.rs
len
called by 422
crates/errors/src/emitter/mod.rs
emit_err
called by 386
crates/passes/src/type_checking/visitor.rs
kind
called by 344
crates/parser-rowan/src/parser/mod.rs
write
called by 313
crates/fmt/src/output.rs
span
called by 311
crates/ast/src/common/path.rs

Shape

Method 2,081
Function 1,867
Class 419
Enum 105
Interface 28

Languages

Rust100%
C++1%
C1%
TypeScript1%

Modules by API surface

crates/passes/src/errors/type_checker.rs136 symbols
crates/parser/src/rowan.rs134 symbols
crates/lsp/src/compiler_bridge.rs130 symbols
crates/fmt/src/format.rs126 symbols
crates/lsp/src/server.rs118 symbols
crates/parser-rowan/src/parser/expressions.rs115 symbols
crates/parser-rowan/src/parser/mod.rs92 symbols
crates/parser-rowan/src/parser/types.rs65 symbols
crates/lsp/src/semantics.rs60 symbols
crates/ast/src/passes/visitor.rs58 symbols
crates/compiler/src/compiler.rs57 symbols
crates/ast/src/passes/reconstructor.rs57 symbols

For agents

$ claude mcp add leo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page