1 unstable release

0.1.0 Jul 12, 2023

#471 in Programming languages

Download history 3/week @ 2024-02-12 18/week @ 2024-02-19 22/week @ 2024-02-26 10/week @ 2024-03-04 16/week @ 2024-03-11 15/week @ 2024-03-18 19/week @ 2024-03-25 32/week @ 2024-04-01

85 downloads per month
Used in 5 crates (3 directly)

MIT license

5KB
78 lines

AirScript

A domain-specific language for expressing AIR constraints for STARKs, especially for STARK-based virtual machines like Miden VM.

An in-depth description of AirScript is available in the full AirScript documentation.

WARNING: This project is in an alpha stage. It has not been audited and may contain bugs and security flaws. This implementation is NOT ready for production use.

Overview

AirScript is a domain-specific language for writing AIR constraints for the STARK proving system. The primary goal of AirScript is to enable writing and auditing AIR constraints without the need to learn a specific programming language (e.g., Rust). The secondary goal is to perform automated optimizations of constraints and to output constraint evaluator code in multiple target languages (e.g., Rust, Miden assembly, Solidity etc.).

Project Structure

The project is organized into several crates as follows:

Crate Description
Parser Contains the parser for AirScript. The parser is used to parse the constraints written in AirScript into an AST.
IR Contains the IR for AirScript, AirIR. AirIR is initialized with an AirScript AST, which it converts to an internal representation that can be optimized and used to generate code in multiple target languages.
Winterfell code generator Contains a code generator targeting the Winterfell prover Rust library. The Winterfell code generator converts a provided AirScript AirIR into Rust code that represents the AIR as a new custom struct that implements Winterfell's Air trait.
Miden assembly code generator Contains code generator targeting the Miden VM. Miden assembly code generator converts AirIR into Miden assembly module contain constraint evaluation and related logic.
AirScript Aggregates all components of the AirScript compiler into a single place and provides a CLI as an executable to transpile AIRs defined in AirScript to the specified target language. Also contains integration tests for AirScript.

Contributing to AirScript

AirScript is an open project and we welcome everyone to contribute! If you are interested in contributing to AirScript, please have a look at our Contribution guidelines. If you want to work on a specific issue, please add a comment on the GitHub issue indicating you are interested before submitting a PR. This will help avoid duplicated effort. If you have thoughts on how to improve AirScript, we'd love to know them. So, please don't hesitate to open issues.

References

  1. Logos: Library for generating fast lexers in Rust.
  2. LALRPOP: LR(1) Rust parser generator framework.
  3. Codegen: Library for generating Rust code.
  4. mdBook: Utility for creating online documentation books.

License

This project is MIT licensed.


lib.rs:

This crate is pulled in from the Firefly compiler, licensed under Apache 2.0

No runtime deps