Crate ashlang

Source
Expand description

Build Docs Version

A language designed to compile and execute on mathematical virtual machines.

Simplicity is the philosophy of ashlang. The language is simple to learn and expresses relationships very close to the arithmetization. Functions are globally available to encourage the development of a single, well audited, well maintained standard library of logic that can be re-used in many proving systems.

§Targets

ashlang currently supports two targets:

  • ar1cs - an extended rank 1 constraint system that includes witness calculation instructions
  • tasm - a novel assembly language used to express instructions for the Triton VM

§Provers

ashlang supprts proving on the following systems:

§Language

ashlang is a scripting language for expressing mathematical relations between scalars and vectors in a finite field.

The language is untyped, with each variable being one of the following:

  • scalar
  • vector
  • matrix (of any dimension)

ashlang is designed to be written in conjunction with a lower level language. Each file is a single function, it may be invoked using its filename. Directories are recursively imported and functions become globally available.

§Features

  • element-wise vector operations
  • throws if vectors of mismatched size are used in an operation e.g. val[0..10] * lav[0..5]
  • functions cannot be declared, each file is a single function
  • files are not imported, function calls match the filename and tell the compiler what files are needed
  • r1cs witnesses can be computed without specialized code

Modules§

compiler
log
parser
Ashlang source code parser.
r1cs
Core logic for the r1cs target. Core logic for the r1cs target.
rings
Concrete ring instances used by ashlang compile targets.
tasm
Core logic for the tasm target.

Structs§

Config
Compiler configuration. Contains all fields necessary to compile an ashlang program.
SpartanProver
Bindings for executing ashlang programs in the microsoft/spartan prover.
TritonVMProver
Bindings for executing ashlang programs in the tritonVM/triton-vm prover.

Traits§

AshlangProver
A trait representing an abstract prover implementation. The generic argument indicates the type of the proof that the prover builds.